Tag Archives: zend framework

Doctype declaration (Zend Framework)

The following snippet will add a doctype declaration to your views. Modify Bootstrap.php . protected function _initDoctype() { $this->bootstrap(‘view’); $view = $this->getResource(‘view’); $view->doctype(‘XHTML1_STRICT’); }

Posted in PHP | Also tagged , , , , | Leave a comment

Abstract database models with PDO MySQL (Zend Framework)

Zend Framework allows you to create models which extend Zend_Db_Table_Abstract. The snippets below demonstrate abstract database models.

Posted in PHP | Also tagged , , , , , , | 1 Comment

Disable layout and modify HTTP response headers (Zend Framework)

Suppose you want to send an XML file or an image to a user. Your controller would need to disable the layout (if there is one enabled) and change its headers.

Posted in PHP | Also tagged , , , , , | Leave a comment

Mapping URLs to action parameters (Zend Framework)

Suppose you want to map /fetch/google.com to the fetch action within the Fetch controller with google.com as a parameter. Zend Framework allows you to create a regex route for this purpose.

Posted in PHP | Also tagged , , , , , , , | Leave a comment