zend-framework

Zend Framework isn't looking for camel cased actions when using the router

Hi guys im having a spot of bother, hope someone can shed some light on this. For some strange reason my route comes up saying action does not exist unless i change the camel casing to all lower case for that actions name then it works fine. but then that goes against the naming conventions! and i dont want to make my code sloppy either...

Zend OpenId and Google

Does the current Zend_OpenId ( Release 1.10.8 ) work with Google? I am working on a project that will only use OpenId ( and maybe OAuth ) as the login and would love to know before spending countless hours with the dreaded Zend Framework :) ...

Zend_Session SaveHandler for Memcache

Recently discovered that Zend_Session's DbTable SaveHandler is implemented in a way that is not very optimized for high performance, so, I've been investigating changing over to using Memcache for session management. I found a decent pattern/class for changing the Zend_Session SaveHandler in my bootstrap from DbTable to Memcache here a...

How can I get the list of metazones from Zend Framework's Zend_Locale?

Hi, I'm trying to have a list of all the most common time zones for a UI component. By digging in the Zend framework I found that supplementalData.xml (used by the Zend_Locale component) has a list of metazones, with prefered TZ database time zone names <mapTimezones type="metazones"> <mapZone other="Acre" territory="001" ...

Zend <dt> <dd> decorators: what do I lose by removing them

This question is specific to Zend_Form. Zend_Form adds standard decorators such as <dd> <dt> <dl>. What do I lose if I were to remove them? Are they used by Zend_Form itself for error reporting or any other reason? ...

Zend form setRequired(true) or addValidator(NotEmpty)

Is there any real difference between the behavior or output of these 2. They look to me like they do the same thing. ->addValidator('NotEmpty') ->setRequired(true) ...

Zend_Form outputs without main HTML HEAD BODY tags

In my index/index action, I'm calling a form class that I created, and output the form in the index.phtml view like this <?php echo $this->form; But when I view the page source, all I'm getting is the form markup. I don't get any HTML HEAD BODY tags to make this a valid markup page. How do I add these to all my pages? I have layouts/...

Zend_View helpers not availble when manually calling $view->render(): how to fix it?

I recently discovered that view helpers seem to be unavailable when manually calling $view->render(). In this particular case, I've got a config view helper which I can easily call from within my view scripts like so: $this->config()->some->param I am now trying to send a mail and discover that the above does not seem to work when m...

Using Zend_Controller_Route to automatically determine the controller based on the user role: how?

I am currently figuring out a way to the the above. My current application structure is as follows: /modules / modulename /controllers /ProjectController.php The application has 3 different user roles, each with functionality contained within these modules. I'd like to prevent having multiple actions for each user role in one...

How to create complex Zend_Form to emulate iTunes Smart Playlist

Hi all, I'm developing an app which runs complex, configurable searches over multiple database tables, and displays the results. I have identified a number of different types of search I'd like to run, and have hard-coded the SQL queries to get the correct results. Each part of the queries have been abstracted, so building a query is as...

PHPUnit: "Invalid value passed to setPost()" when passing Zend_Db_Table_Row_Abstract converted using toArray()

The following code fails throws a Zend_Controller_Exception ("Invalid value passed to setPost(); must be either array of values or key/value pair") /** Model_Audit_Luminaire */ $luminaireModel = new Model_Audit_Luminaire(); if (!$fixture = $luminaireModel->getScheduleItem($scheduleId)) { $this->fail('Could not retrieve fixture from ...

Is there a way to use google analytics to track calls to a json response?

I am working on a app that uses a json response from my Zend Framework 1.10 website. I want to track how many times the Json Action is hit? If there is no true way to do this from just the action that is not reflected the json response. ...

Zend Framework: Post to different action then return to original action if fails validation AND keep form fields

This might sound like an odd scenario, but I've got two forms on one page. One is just posting back to itself. I made the second post to another action to keep the code cleaner. Maybe not the right choice... The problem I'm having now is that if that second form doesn't validate, I redirect back to the page with the form but I don't kno...

Zend changing validation error behavior: wrapping element in another tag

I've set a validator for the email so it can't be empty. This is the markup of the usual form that zend_form generates: <dt id="email-label"><label class="required" for="email">Email</label></dt> <dd id="email-element"> <input type="text" value="" id="email" name="email"> </dd> When validation fails, zend_form adds a new ul class...

Two similar applications on different domains but same users

I'm planning on building two applications using Zend Framework that are very similar but serve two different purposes that can't be part of the same application or be combined into one. However, modules are something I'm considering. The issue I'm running into is if a user registers for the first application I want that information be a...

Can custom decorator access parts of $content

In a custom decorator, I'm wrapping the element content with a div. This code creates a div around both the <dt> label and the <dd> element public function render($content) { return '<div class="test">' . $content . '</div>'; } Is there a way I can further access those 2 parts, the dd and dt. Such as maybe wrap the div arou...

Module-specific Controller plugins in Zend Framework

Hi, My Zend Framework project is divided into certain Modules. Each Module has some specific Controller Plugins. Now, the problem is that all plugins get loaded and registered (and thus, called) - no matter which module the user is trying to access. I could test in which module we are and stop execution directly in the plugins, but I ...

Zend Framework: How to call a custom function created in bootstrap?

Hi I am using Zend Framework v 1.10 I have created a custom function in the bootstrap file: <?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { public function init(){ } public function helloworld(){ echo 'hello';} } ?> How do I call the helloworld() function from an Action within the Index Controller? ...

Zend framework module, controller, action specific routes

Hi, In my zend framework application, I have routes and defaults like: resources.router.routes.plain.defaults.module = "index" resources.router.routes.plain.defaults.controller = "index" resources.router.routes.plain.defaults.action = "index" I want to be able to change default routes for any module or controller or action e.g. Let'...

Zend: Quick and succinct way of inserting custom HTML into a Zend_Form?

Is there some method that accepts inserting custom html without having to actually add form controls, even if they're hidden and making my html a decorator? I'm looking for something like: $this->addCustomElement( array( 'div', 'body' => '<p>inner text</p>' ) ); I need something short and quick, I don't want to create a new class or...