Skip to content

Instantly share code, notes, and snippets.

View kaiohken1982's full-sized avatar

Sergio Rinaudo kaiohken1982

View GitHub Profile
@kaiohken1982
kaiohken1982 / menu.phtml
Created May 13, 2013 12:55
Twitter bootstrap markup for zf2 navigation
<?php
/**
* Funzionalità iterativo-ricorsiva per la generazione del menù
*/
if(!function_exists('renderMenu')) {
function renderMenu($container, $obj, $step = 0) {
$html = '';
if(null !== $container && $container->count()) {
if(!$step) {
@kaiohken1982
kaiohken1982 / gist:4360425
Created December 22, 2012 18:42
Static login route
routes.login.type = "Zend_Controller_Router_Route_Static"
routes.login.route = login.html
routes.login.defaults.module = default
routes.login.defaults.controller = auth
routes.login.defaults.action = login
@kaiohken1982
kaiohken1982 / Album.php
Created September 21, 2012 13:16
Zend Framework 2: get the ServiceManager in an Entity
<?php
namespace Album\Model;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
class Album implements ServiceManagerAwareInterface
{
protected $serviceManager;
@kaiohken1982
kaiohken1982 / moduleLayout
Created September 21, 2012 12:53
Zend framework 2 specific layout for a module
<?php
namespace MyModule;
use Zend\ModuleManager\ModuleManager;
class Module
{
public function init(ModuleManager $moduleManager)
{
$sharedEvents = $moduleManager->getEventManager()->getSharedManager();
@kaiohken1982
kaiohken1982 / git submodule update
Created December 28, 2011 05:47
Git, how to update a submodule
# get the submodule initially
git submodule add ssh://bla submodule_dir
git submodule init
# time passes, submodule upstream is updated
# and you now want to update
# change to the submodule directory
cd submodule_dir
@kaiohken1982
kaiohken1982 / Multicheckboxes.php
Created December 22, 2011 14:36
Zend Form Element Multicheckboxes unordered list tag ul
<?php
class My_Form_Template extends My_Form
{
public function init()
{
parent::init();
$this->addElements(array(
$this->createElement(self::TYPE_MULTICHECKBOX, 'checks', array(
@kaiohken1982
kaiohken1982 / Multicheckbox.php
Created December 22, 2011 14:09
Multicheckbox decorator single checkbox
<?php
class My_Form_Template extends My_Form
{
public function init()
{
parent::init();
$this->addElements(array(
$this->createElement(self::TYPE_MULTICHECKBOX, 'checks', array(
@kaiohken1982
kaiohken1982 / jquery-clearform.css
Created November 14, 2011 16:07 — forked from egm0121/jquery-clearform.css
Clear Form JS jQuery Plugin
.clearform{
display:inline-block;
margin-left:-16px;
cursor:pointer;
width:10px;
height:10px;
background-image:url('/close.gif');
-webkit-box-shadow: 0px 0px 10px 5px #fff ;
}