zend-framework

How do I add a class name to <li> from Zend Navigation XML

∥☆過路亽.° 提交于 2020-01-02 08:38:39
问题 Can someone please help me out, I'm totally stuck! I don't know how to add a class name to <li> tag in Zend navigation XML This is my XML <configdata> <nav> <home> <label>Home </label> <uri>/</uri> </home> <request> <label>Quotes </label> <uri>/quote</uri> </request> <work> <label>How It Works</label> <uri>/how-it-works</uri> </work> <information> <label>Informations </label> <uri>/informations</uri> </information> <directory> <class> last </class> <label>Directory </label> <uri>/directory<

Zend_Test: No default module defined for this application

ぐ巨炮叔叔 提交于 2020-01-02 06:59:26
问题 UPDATE 23 Dec I had the problem where Zend Framework complains about "No default module defined for this application". I didn't use Modules and the main app works fine. I finally solved the problem with the help from weierophinney.net Your bootstrap needs to minimally set the controller directory -- do a call to $this->frontController->addControllerDirectory(...) in your appBootstrap() method. I didn't in my example, as my Initialization plugin does that sort of thing for me. The problem is

Validating multiple optional form fields with Zend Framework

喜你入骨 提交于 2020-01-02 06:09:36
问题 I am trying to validate Zend_Form which has several optional fields and I want at least one of them to be filled in. In my case I have mobile, home and office phone numbers and I want at least one of them to be provided. I am trying to achieve this though Validation Context (as suggested here) by creating custom validator which extends Zend_Validate_Abstract. The problem is that if all optional fields are empty they are missing from the form $context (passed to the validator class) and this

Zend Form Element with Javascript - Decorator, View Helper or View Script?

风流意气都作罢 提交于 2020-01-02 05:57:49
问题 I want to add some javacsript to a Zend_Form_Element_Text . At first I thought a decorator would be the best way to do it, but since it is just a script (the markup doesn't change) then maybe a view helper is better? or a view script? It seems like they are all for the same purpose (regarding a form element). The javascript I want to add is not an event (e.g. change, click, etc.). I can add it easily with headScript() but I want to make it re-usable , that's why I thought about a decorator

HMVC in Zend Framework

二次信任 提交于 2020-01-02 05:39:07
问题 Is it possible to use the HMVC pattern in Zend Framework? It is implemented in Kohana 3 by default and I really love it, so now I want to use it in Zend Framework. Edit I want to make it possible to: 1) include a complete request (like controller/action) inside an other request 2) make a direct call to the controller/action as above It is not only used for widgets, but I also want to build a page which contains content of other pages... Edit 2 To be a bit more clear: I do have a page object

Optimize my performance

我是研究僧i 提交于 2020-01-02 03:46:13
问题 I'm working on a project with Zend Framework 1.11, Doctrine 2, some Symfony 2 componenents and others tools & libraries. I'm trying to optimize performance using Xdebug & Webgrind. I've already found some bottlenecks like parsing Ini config, etc.. and cached that. Now, I just realize that the autoloading is the most costly part of my application: Opl\Autoloader\ApcLoader->loadClass 274 31.36 43.86 Zend_Loader_PluginLoader->load 150 4.80 12.29 Zend_Loader_Autoloader->getClassAutoloaders 278 1

how to check full error log in Zend framework?

半城伤御伤魂 提交于 2020-01-02 02:52:12
问题 I am newbie in ZF and this is my first test. i am getting An error occurred An error occurred my error.phtml is <h1>An error occurred</h1> <h2><?php echo $this->message ?></h2> <?php if (isset($this->exception)): ?> <h3>Exception information:</h3> <p> <b>Message:</b> <?php echo $this->exception->getMessage() ?> </p> <h3>Stack trace:</h3> <pre><?php echo $this->exception->getTraceAsString() ?> </pre> <h3>Request Parameters:</h3> <pre><?php echo $this->escape(var_export($this->request-

Creating and updating Zend_Search_Lucene indexes

我与影子孤独终老i 提交于 2020-01-02 02:24:06
问题 I'm using Zend_Search_Lucene to create an index of articles to allow them to be searched on my website. Whenever a administrator updates/creates/deletes an article in the admin area, the index is rebuilt: $config = Zend_Registry::get("config"); $cache = $config->lucene->cache; $path = $cache . "/articles"; try { $index = Zend_Search_Lucene::open($path); } catch (Zend_Search_Lucene_Exception $e) { $index = Zend_Search_Lucene::create($path); } $model = new Default_Model_Articles(); $select =

Zend framework 2 : How to set locale globaly?

帅比萌擦擦* 提交于 2020-01-02 01:55:31
问题 I have to change the locale dynamically depending which language the user wants. I can set the locale in the Application/Module.php like this : public function onBootstrap(MvcEvent $e) { $translator = $e->getApplication()->getServiceManager()->get('translator'); $translator->setLocale('hu_HU'); } But, how can I do this in the controller, if I want to change languages ? I tried this, but after this I can change the locale only for this one request and not global. $translator = $this-

Issue installing PHP pthreads on Ubuntu Server

戏子无情 提交于 2020-01-01 22:40:07
问题 I am trying to install pthreads on my Ubuntu 12.04 server that is running PHP Version 5.5.8-3+sury.org~precise+2. To my knowledge this was just a standard installation via apt-get. I then try and run sudo pecl install pthreads this produces the following error: checking checking for ZTS... configure: error: pthreads requires ZTS, please re-compile PHP with ZTS enabled I understand that this means PHP was not compiled with the --enable-maintiner-zts ./config flag. What I DON'T know how to do