How do I extend the Zend Navigation Menu View Helper?

$view->addHelperPath( APPLICATION_ROOT . ‘/library/MyApp/View/Helper/Navigation’, ‘MyApp_View_Helper_’ ); echo $this->navigation()->myMenu(); // name of your class From: Getting Zend_Navigation menu to work with jQuery’s Fisheye EDIT Sorry I’ve not seen your solution, it is exactly what I’ve posted. But why this is not a trully extension of menu class?

Selecting all fields except only one field in mysql [duplicate]

you can do it easily like that lets say your field is an id = 5 then select * from your_table where id !=5 and if you mean columns lets say you dont want select column3 then select column1,column2,column4 from tablename; if you have many columns SET @sql = CONCAT(‘SELECT ‘, (SELECT REPLACE(GROUP_CONCAT(COLUMN_NAME), ‘<columns_to_delete>,’, ”) … Read more

Practical Zend_ACL + Zend_Auth implementation and best practices

My implementation: Question #1 class App_Model_Acl extends Zend_Acl { const ROLE_GUEST = ‘guest’; const ROLE_USER = ‘user’; const ROLE_PUBLISHER = ‘publisher’; const ROLE_EDITOR = ‘editor’; const ROLE_ADMIN = ‘admin’; const ROLE_GOD = ‘god’; protected static $_instance; /* Singleton pattern */ protected function __construct() { $this->addRole(new Zend_Acl_Role(self::ROLE_GUEST)); $this->addRole(new Zend_Acl_Role(self::ROLE_USER), self::ROLE_GUEST); $this->addRole(new Zend_Acl_Role(self::ROLE_PUBLISHER), self::ROLE_USER); $this->addRole(new Zend_Acl_Role(self::ROLE_EDITOR), self::ROLE_PUBLISHER); … 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

How do detect that transaction has already been started?

The framework has no way of knowing if you started a transaction. You can even use $db->query(‘START TRANSACTION’) which the framework would not know about because it doesn’t parse SQL statements you execute. The point is that it’s an application responsibility to track whether you’ve started a transaction or not. It’s not something the framework … 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.

Threads in PHP?

EDIT (thanks @Efazati, there seems to be new development in this direction) http://php.net/manual/en/book.pthreads.php Caution: (from here on the bottom): pthreads was, and is, an experiment with pretty good results. Any of its limitations or features may change at any time; […] /EDIT No threads in PHP! The workaround is to store jobs in a queue … Read more

Add some html to Zend Forms

The only way I can think of at the moment is to add a dummy element to the form and remove all decorators except an ‘HtmlTag’ with the attributes you specified in your question. Removing the decorators means that the actual element will not be rendered – only the HtmlTag decorator will be rendered. so … Read more

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