zend-framework

Adding helper paths in Zend Framework for nested helpers

Does every level of view helpers really have to be added as its own separate path? What I mean is this. I have found Zend's method of naming and nesting files a great way to organize user.php lives in the object folder and extends object.php. /DisplayObject /Object User.php I started attempting to organize my view helpers i...

Is there better way to access configs from Conroller plugin in Zend Framework

Just need get some vals located in application.ini(main ini) in the Controller plugin I know I can create an instance of Zend_config_Ini but would like to use the existing resource (application.ini is already used in Front Controller) ...

Doctrine 2.0 integration into Zend Framework 1.10

Hi, can anybody help me how to nice integrate doctrine 2.0 into ZF 1.10? I found some application resources, but there was no complete solution. Many thanks ...

how to decorate the error message

this is the decorator code $mydecorate = array( 'ViewHelper', array('Errors', array('placement' => 'append','class' => 'error')), array('Label', array('separator' => '')), array('HtmlTag', array('tag' => 'p', 'class' => 'element-form')) ); html result of two input elements with the above decorator: <p...

Zend Lucene displays blank screen when no results found

When I submit a query to Zend_Lucene with a string that exists in the index, the results are displayed as expected, however when string is not found, I get a blank page with no error messages. Code used as below: require_once 'Zend/Feed.php'; require_once 'Zend/Search/Lucene.php'; $index = Zend_Search_Lucene::open('data/my-index'); $que...

How to calculate "time until" a certain date using PHP and the Zend Framework?

I have two Zend Date objects to work with: $now = Zend_Date::now(); $sessionStart = new Zend_Date('2010-04-01 10:00:00', 'yyyy-MM-dd HH:mm:ss'); I need to calculate the time remaining and display in a human readable manner. The session will begin in 7 days. The session will begin in 30 minutes. How can I do this with PHP and the Ze...

Commitment to Zend Framework - any arguments against?

I am refurbishing a big CMS that I have been working on for quite a number of years now. The product itself is great, but some components, the Database and translation classes for example, need urgent replacing - partly self-made as far back as 2002, grown into a bit of a chaos over time, and might have trouble surviving a security audit...

How does Zend_Db_Table_Select work?

I'm trying to figure out how to use Zend_Db_Table_Abstract correctly. I want to return just the name column from my query. Can you please explain what's wrong with the following code? class Model_DbTable_Foo extends Zend_Db_Table_Abstract { protected $_name = 'foo'; public function getFooById($id) { $select = $this->select(tr...

Zend Framework Autoloading in 3 modules

I am new to ZF and I am writing in Zend Framework 1.10 . Here is my application directory structure. APPLICATION_PATH` ├─configs ├─layouts └─modules ├─admin │ ├─controllers │ ├─forms │ ├─models │ └─views │ ├─filters │ ├─helpers │ └─scripts │ ├─authentication │ ...

Zend framework Internal structure modification?

What class(FrontController , Bootstrap, Dispacher....) sets up the default structure path in ZF? ...

Zend Framework url redirect

<?php class PI_Controller_Plugin_AssetGrabber extends Zend_Controller_Plugin_Abstract { public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) { /* The module name */ $moduleName = $request->getModuleName(); /* This modules requires the user to be loggedin in order to see the web p...

What's the simplest way to create a Zend_Form tabular display with each row having a radio button?

I've seen simple examples of rendering a Zend_Form using decorators, but I'm not sure they are able to handle the issue I'm facing very well. I query the database and get an array of user objects. I want to display these users as a form, with a radio button next to each of them and a submit button at the bottom of the page. Here's rou...

Keeping Track of Dependent Third-party Library Releases

I am building a web application that is dependent upon several third-party libraries. What is a good strategy for making sure that you're always using the most fully patched versions? A simple method would be to keep the versions written down and visit the websites at regular intervals, but I am looking for some way to get the informat...

Zend headScript() and appendFile not working as expected

I'm having an issue trying to append a javascript file using headScript()->appendFile('file name') with Zend. I have my layout setup like this: <?= $this->headScript() ->prependScript( 'BASE_URL = "' . $this->baseUrl() . '";' ) ->appendFile( $this->baseUrl('js/lib/jquery/jquery-1.4.2.min.js') ) ->appendFile( $this->base...

How to change Zend_Db_Table name within a Model to insert in multiple tables

Using Zend Framework, I've created a Model to insert a record into a database. My question is, after $this->insert($data) how can I switch the active table so that I can insert a record into another table? Here's my code so far: class Model_DbTable_Foo extends Zend_Db_Table_Abstract { protected $_name = 'foo'; public function add...

Zend Framework 1.1 Modules setup

i used zend_tool to setup a project then to create module blog with index controller etc but i guess the default config setup by zend_tool does not work with modules so i edited it resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.frontController.moduleDirectoryControllerName = "controllers" i guess th...

Zend Framework: how to remove rendered views in the controller?

i want to render one of these sets of views: head body-$id1 foot OR head body-$id2 foot which set exsists. i do it like this: try { $this->render("head"); $this->render("body-$id1"); $this->render("foot"); } catch (Exception $e) { $this->render("head"); $this->render("body-$id2"); $this->render("foot"); ...

Zend Framework: Autoloading module resources in config.ini?

Is it possible, to configure the following behaviour in application.ini? <?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initAdminModuleAutoloader() { $this->_resourceLoader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Admin', 'basePath' => APPLI...

Zend_Db_Table - Update don't work

The code seems not working. // $counter is an instance of Zend_Db_Table_Abstract $counter->update(array('hits' => 'hits+1'), '"id" = 1'); I took a look into the DB profiler and find the following query: UPDATE `downloads` SET `hits` = ? WHERE ("id" = 1) ...

Can't reach the new zend controller/view

Hi, I've installed Zend Studio 7.1.1 that contains 1.9 framework. For the server side, I use easyphp (very similar to wamp) When I create the project, I obviously obtain this architecture: MyProject |-- application | |-- Bootstrap.php | |-- configs | | `-- application.ini | |-- controllers | | |-- ErrorController.php | ...