Categories
Zend Framework 1.12

Zend_form populate() not working?

Zend_form populate() not working Below are a few reasons and a method for correcting: Zend_form populate() not working 1. Get the record used to populate $myModel = new Model_My(); $id = $this->_request->getparam(‘id’); $record = $myModel->find($id)->current(); 2. Make Sure is the form of key value pairs array Zend_Debug::dump($record->toArray()); 3. Make Sure you are calling correctly $frmResource […]

Categories
Zend Framework 1.12

Add Events to Zend_Forms Zend Framework

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

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 […]

Categories
Zend Framework 1.12

Get the Current Action, Controller or Module with Zend Framework?

From within a controller: $controller = $this->getRequest()->getControllerName(); $action = $this->getRequest()->getActionName(); From within a view: Zend_Controller_Front::getInstance()->getRequest()->getControllerName(); Zend_Controller_Front::getInstance()->getRequest()->getActionName();