Category: Zend Framework

Friendly URLs and the Zend Router

Creating custom friendly URLs using the Zend framework is really simple. The default routing setup for Zend is : ‘:module/:controller/:action/*’, (* will match any var/value) which is fine for most setups. However on some pages having the var/value might not look very good, for example this url is not very readable: /popular/index/type/images/page/1/sortOrder/alltime (controller/action/var/value/var/value/var/value) We would…

Creating a custom View Helper in the Zend Framework

Zend Framework ships with several View Helpers, such as the url View Helper. Anywhere in a view script one can call $this->url() to generate a url to a certain page. For example: $this->url(array(   ‘module’ => ‘moduleName’,   ‘action’ => ‘actionName’,   ‘additionalParam’ =>‘value’)) I wanted to create my own helper, for generating paths to…