zend-framework

Why does the Zend framework prepend an underscore here?

What's the point of having $_comment instead of $comment? class Default_Model_Guestbook { protected $_comment; protected $_created; protected $_email; protected $_id; protected $_mapper; ...

Zend Framework: How to concatenate two columns and still use fetchPairs() ?

I have a form with a select element that I need to populate with values from a database. Specifically, the name and id of the current users. The fetchPairs() function works great for this! However, I need to concatenate the value from the first_name column and the last_name column and display this as the option label. Is there a way to d...

Zend Framework call view helper from a Zend_View_Helper

I have a helper called Zend_View_Helper_FormVars that's used by one of my modules. I also have a common helper in application/common/helpers/GeneralFunctions.php I'm trying to call a function from Zend_View_Helper_FormVars that's in GeneralFunctions.php Here is the sort version of Zend_View_Helper_FormVars class Zend_View_Helper_Form...

Zend_Mail and =0D=0A=3D=3D=3D=3D=3D

I'm writing a help desk pipe handler to pipe incoming e-mails as helpdesk ticket replies. Some e-mails are coming in perfectly fine, others are coming in as a jumble of the text and =3D's all munged into one giant string. Does anyone have an idea on how to decode that into plain text. For reference, this is my mail parser function: pu...

Last.fm or Spotify API

Hello, I was hoping someone could offer me advice, Im looking to build a website, and was hoping that I could inergrate my last.fm radio station or my spotify account into it so the users can listen to what I am. I know there are API's for each but do any of them support listening to music, nothing seems conclusive in there documentati...

Use a controller in another one using zend

I have a controller for example "Price" also another one "Testprice" both using the same database table and the functionality are same only difference for "Testprice" the table have field test value true and for "Price" test = false . How can i extend the "Price" controller to this "Testprice" :) ...

Multiple application instances on the same database

Hello! I'm writing an application that that I'm going to provide as a service and also as a standalone application. It's written in Zend Framework and uses MySQL. When providing it as a service I want users to register on my site and have subdomains like customer1.mysite.com, customer2.mysite.com. I want to have everything in one datab...

Manual dispatching possible in Zend Framework?

Hello guys, i'm wondering how i can manually start execute a controller action of my MVC application. My goal is to integrate the html output of /myController/myAction into another php application (typo3) using a simple include. I thought of manually instantiating the controller, the view and the layout, to bypass the dispatcher. Sadly ...

PHP Zend Framework - Zend_Config and global state

I'm in the process of evaluating the benefits of Zend_Config_Ini versus using a simple constant file. e.g. - define('DB_HOST',localhost); //versus $config = new Zend_Config_Ini('/path/to/config.ini', 'staging'); echo $config->database->params->host; // prints "dev.example.com" The only thing is that the $config is not globally ac...

Zend Framework - pass variable to every controller

Hi! I'm working on multi-tenant application in Zend Framework which gets it's tenantID from the subdomain name (mod_rewrite -> index.php -> matches it against the database). My question is - how do I set this variable (tenant id) to be available for every Controller? Leonti ...

Unit Testing (PHPUnit): how to login?

hi there, I'm writing tests for my current project, made with Zend Framework. Everything fine, but I have a problem testing the logged users actions/controllers: I need to be logged in to be able to perform the action/controller. So my question is: How can I be logged in in PHPUnit? thans for reading :) ...

zend framework custom validation classes

I'm writing a custom validator that is going to check for the existence of an email such that if it already exists in the database, the form is not valid. I'm having a hard time figuring out helper paths and namespaces for custom Zend_Validation classes. I'd like to call the class My_Validate_EmailUnique but I keep getting error message...

removing items from a dojo datagrid

Hi, I am struggling with a simple dojo datagrid in my Zend Framework project. I have a list of data from a mysql table that I can display, however I want users to be able to remove selected rows (and remove them from the db). I am using the example from Dojo DataGrid adding and deleting data. My code in my view for the datagrid looks...

Is there a way to generate a zfproject.xml file from an existing Zend project/application?

I'm on Debian Lenny if that matters, in terms of me possibly needing something like Zend Studio - I'm wondering if Zend_Tool can do this somehow. ...

How to Make Zend_Controller_Router resets un-wanted parameter by default

Hi, I'm using Zend-Framework 1.9.5 to make a web-application, But it's Url_Helper was quite tricky to me in the matter of parameter reset!, I know it's a good feature (parameter preserving) but in most cases I don't need it!. So I'm thinking of overriding the default Router to force it loosing parameters Unless I ask for it or maybe spec...

Zend Framework - get front controller from bootstrap ?

Hi, I'm trying to implement routes into my bootstrap file with this code ; protected function _initRoutes() { $router = $this->getResource('frontController')->getRouter(); $router->addRoute( 'profil', new Zend_Controller_Router_Route ( 'profil/:username', array ( 'controll...

Zend_Form - XML

I set up my Zend_Form with XML, now just one line I couldn't transfer to XML. /* Do some stuff like $form = new Zend_Form etc */ $form->removeDecorator('HtmlTag'); How could I add removeDecorator to XML? My try: <forms> <login> <action>form/</action> <method>post</method> <options> <removeDecorator>HtmlTag</remo...

Implementing a dynamic sidebar in zend without calling an extra action

Currently trying to come up with a "best practice" for a ZF site that is both elegant and efficient. What I am trying to do is just generate data for a sidebar. In a couple of related questions and on other sources, the approach taken was to call another action from the sidebar part of your layout, or to add the sidebar action to an act...

Zend Framework: Controller class == Page?

Am I right in thinking that in Zend Framework, if I plan to have 5 pages at my site, I'd generally need 5 controllers? Do ZF developers typically create 1 controller per page ("page" as abtract app unit)? The reason I am asking this is that previously for some reason I stuffed a lot of various actions into controllers so that they playe...

What does "Automatic cleaning is not available/necessary with this backend" mean? (for memcache )

I have installed the memcache in my php zend code. it seems no error. but there is a warning in the log saying Zend_Cache_Core::save() / automatic cleaning is not available/necessary with this backend. what does it really mean? ...