Categories
Zend Framework 1.12

Add Events to Zend_Forms Zend Framework

$type = new Zend_Form_Element_Select(‘type’,array(‘onchange’ => ‘alert(“working”)’));

Categories
PHP 5

using PHP Values as Variable names and to call Functions

This should apply to perl as well: Variable name: $myvar = ‘foo’; ${$myvar} = ‘haswell’; echo $foo RESULT ‘haswell’ Call a function: $type = ‘red’; $myClass->$type(); == $myClass->red(); Taken from: More helpful stuff: ${“variableName”} = 12; {“functionName”}(); $className->{“variableName”}; $className->{“methodName”}(); StaticClass::${“variableName”}; StaticClass::{“methodName”}(); Are there any other Languages that can do this, I know Perl Can… And […]

Categories
PHP

Loop Through an Associative Array PHP

foreach (array_expression as $key => $value) { echo $key; }

Categories
Zend Framework 1.12

Populate a single field in a form Zend Framework

$form->populate(array(“id” => $id));

Categories
Zend Framework 1.12

Generating Custom Menu’s with Zend_Navigation

Zend navigation has a number of advantages although performance isn’t one of them: Access Control and some others But it is difficult to add custom code such as drop down carets and glyphicons etc. It has been noted that the community of zend, and myself, do not like Zend Decorators and hence decorators are not […]