Zend File Upload and Element Decorators

The File element requires it’s own decorator – Zend_Form_Decorator_File. $this->setElementDecorators(array( ‘File’, ‘Errors’, array(array(‘data’ => ‘HtmlTag’), array(‘tag’ => ‘td’)), array(‘Label’, array(‘tag’ => ‘th’)), array(array(‘row’ => ‘HtmlTag’), array(‘tag’ => ‘tr’)) )); [edit] Have just noticed that you are also using other form elements. After your original code, add: $this->getElement(‘Excel’)->setDecorators( array( ‘File’, ‘Errors’, array(array(‘data’ => ‘HtmlTag’), array(‘tag’ => … Read more

How do I use ViewScripts on Zend_Form File Elements?

The answer is relatively simple as it happens. All you need do is specify the File decorator first, create a specific view script for the file input and specify false for the placement in the viewScript decorator arguments, this will effectively inject the output from the File decorator into the viewScript decorator e.g. $element->setDecorators(array(‘File’, array(‘ViewScript’, … Read more

zend framework deployment in server

Also, these other approaches to deploying in shared hosting can help: Zend Framework on shared hosting http://www.alberton.info/zend_framework_mod_rewrite_shared_hosting.html http://akrabat.com/zend-framework/zend-framework-on-a-shared-host/ http://www.ttech.it/en/article/2010/03/zend-framework-all-projects-files-on-document-root/ In particular, an answer by tharkun led me to write it up in more detail in a blog post.

PHPExcel class not found in Zend Autoloader

Create an autoloader for PHPExcel and add it to the Zend autoloader stack. In library/My/Loader/Autoloader/PHPExcel.php: class My_Loader_Autoloader_PHPExcel implements Zend_Loader_Autoloader_Interface { public function autoload($class) { if (‘PHPExcel’ != $class){ return false; } require_once ‘PHPExcel.php’; return $class; } } And in application/configs/application.ini: autoloadernamespaces[] = “My_” Then, in application/Bootstrap.php: protected function _initAutoloading() { $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->pushAutoloader(new My_Loader_Autoloader_PHPExcel()); … Read more