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

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();

Categories
Server

Apache Enabling mod Rewrite Debian Wheezy

Apache Enabling ModReWrite In order to use mod_rewrite you can type the following command in the terminal: a2enmod rewrite service apache2 restart Then, if you’d like, you can use the following .htaccess file. setEnv APPLICATION_ENV development RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] The above .htaccess file (if […]