Skip to content

Instantly share code, notes, and snippets.

@BinaryKitten
BinaryKitten / Module.php
Created October 9, 2012 12:21
Module as Route in ZF2
<?php
namespace Application;
use Zend\Mvc\MvcEvent;
use Zend\Http\PhpEnvironment\Response;
class Module extends Response {
//BootstrapListenerInterface
public function onBootstrap(MvcEvent $event) {
resources.frontController.plugins.specialRouting.class = "Radd_Controller_Plugin_Acl"
resources.frontController.plugins.specialRouting.stackindex = 0
@BinaryKitten
BinaryKitten / GIT-ALIASES.txt
Last active September 20, 2018 15:16
Useful GIT Aliases
Useful Aliases
lastcommit
shows you the last commit made on the current branch
git lastcommit
git config --global alias.lastcommit "log --pretty=oneline -n 1 --no-merges"
merge-branch
Checks out branch, updates that branch. Then checks back out to last branch and merges specified branch in
git merge-branch <branchname>
<?php
// your module.config.php
return array(
'doctrine' => array(
'connection' => array(
// Configuration for service `doctrine.connection.orm_default` service
'orm_default' => array(
'params' => array(
'user' => 'YOUR_username',
'password' => 'YOUR_password',
<?php
$iterator = new RecursiveIteratorIterator($nav, RecursiveIteratorIterator::CHILD_FIRST);
$activePages = array();
foreach ($iterator as $page) {
if ($page->isActive(true)) {
$activePages[] = $page;
}
}
"repositories": [
{
"type": "composer",
"url": "https://packages.zendframework.com/"
}
],
<?php
return array(
'doctrine' => array(
'driver' => array(
'zfcuser_entity' => array(
'paths' => 'location of your xml files thing'
)
)
),
);
<?php
use Zend\Stdlib\ArrayUtils;
//.....
public function getConfig()
{
$config = array();
$folder = realpath(__DIR__ . '/config');
<?php
namespace Zend\Mvc {
class MvcEvent {
public function getRequest() {}
public function getResponse() {}
public function getApplication() {}
}
}
var shortUrl = window.location.href.replace('@itm/./@gi','itm/');
var item = jQuery('<tr><td class="vi-Vr-itemattrTh"><div class="itm_num_lbl">Shorter URL</div></td><td></td><td width="100.0%">&nbsp;</td></tr>');
item.find('td').eq(1).append($('<a>', { href: shortUrl, 'text': shortUrl }));
item.appendTo('#itemAttrCntr table');