zend-framework

Zend Router precendece problem

Hi, I have got two routes ; category route resources.router.routes.category.type = "Zend_Controller_Router_Route" resources.router.routes.category.route = "shopping/:idTwo/:id/*" resources.router.routes.category.defaults.module = "default" resources.router.routes.category.defaults.controller = "shopping" resources.router.routes.category...

Zend_Mail - how to get only html body from email?

I'm working with emails from google oauth. This is the format I'm using. $emailmessage = $storage->getMessage($i); $fromaddress = $storage->getMessage($i)->from; What format can I use to get only the html body of the email? I've been looking at this document http://framework.zend.com/apidoc/core/Zend_Mail/Zend_Mail.html, but the ...

Zend Db joinLeft with parameterized value

I need to joinLeft within Zend_Db ala: $select->joinLeft(array('ATAG' => 'ad_tags'), array('ADM.id = ATAG.ad_id AND ADM.site_id = ATAG.site_id AND ATAG.tag_id = ?', $input_vars['tag']), array('tag_id')) ->order('ATAG.tag_id DESC') ->limit('1'); However, I can't use an array as the seco...

Zend Framework: How to create an abstract view helper for other view helpers to extend?

I need to create a few custom form elements (with custom view helpers) in my Zend Framework application. The problem is that they are each so similar. I want to create a base view helper class that each of these can extend and an abstract function that I will require is implemented. Solution: So if my Picker element was the abstract cl...

delete with join in Zend-Framework

This're my tables: To update a document I need to delete all functions. What is the best approach to do this in ZendFramework? Is there a solution using delete and join? ...

Is ORM all or nothing?

If I use an ORM let's say with Zend or Symfony. Is it an all or nothing deal? I'd like to use the ORM, but also want to optimize performance in some cases and write the query myself to get to the nitty gritty. So if I start using an ORM, is it going to be difficult to do it the old way once I include it in my project? ...

Doctrine Schema changes to id auto-increment

I'm using YAML to define the doctrine schema and would like to start the id field that's set on auto-increment with a number other than 0, let's say 324 (this is done in mysql by doing something like AUTO_INCREMENT=324. This Google groups thread has a hint that it may be possible to do with command.pre_command event to execute the SQL b...

How to make 'www' optional in a Hostname Route in Zend ?

Hello, Let's say I have the domain "example.com" I would like to add a route such as when the URL is "example.com/whatever/follows" it redirects to "http://www.example.com/whatever/follows" (forwarding the query strings too). Basically I would like to translate into Zend the following Apache Rewrite rule: RewriteCond %{HTTP_HOST} ^exa...

php recursion level

Hello! I have the recursion function. There are an hierarchy users structure. I send a user id to my function and it should find all user under this. Function returns an array of all associates users. My task is to find a levels of this users. For example: User1 / \ User2 User3 / \ \ User4 User5 User6...

Load models in Zend Framework

I tried to search here before creating this, but I couldn't find anything. I have a simple project without modules and I'd like to load my models (which are inside application/models) without using any namespace and without usign any extra loading lines. Basically what I want to do is to have my class Projects extends Zend_Db_Table_Abs...

Route-problem modular App with Zend and multilanguage support

Hello everybody. I'm struggling with the Zend-Router. I want to chain language in my url. Everything works fine but my modular routing. If i call: http://domain.de/en/index - the indexAction of my IndexController of the default module is executed and translated. Same goes for: http://domain.de/en/about So the aboutAction of the IndexCo...

Using PHPUnit on a Zend Framework application, how can I force the locale to be used for a given test?

I am testing a multi-lingual site with phpunit. One of the tests I want to perform is that the application will detect the locale of the user and automatically redirect. That is, user accesses the site on /. The application detects they're from France and redirects to /fr-FR/ The application does appear to do this, but trying to wri...

How do i assign values to the Select Box or hidden value retrived from function

Iam calling a PHP custom function with different parameters which returns a different arrays based on parameters . //Array1 array(1) { ["INDEX_NAME"]=> array(1) { ["XEROX PRINT "]=> string(8) "XEROX VALUE" } } //Array2 array(1) { ["INDEX_NAME"]=> array(2) { ["XEROX PRINT"]=> string(8) "TEST2" ["XEROX PRI...

Zend Framework, passing variables to view.

Hello I have a problem with displaying a view. When I pass var to view, view doesn't render. Controller: public function indexAction() { $branchModel = new Application_Model_Branches(); $branches = $branchModel->getAllBranches(); $this->view->menu = $branches; } View (index.phtml): <h2>Menu</h2> <?php $this->htmlLi...

Autoloading classes when not in same directory as zend library

I've decided that rather than have a copy of the Zend Framework in each application's directory, I'd like to keep it on one location on the server, with the one copy used by all my websites. However, I'd like my app's custom classes to still be within the application folder. So a folder structure a bit like this: webroot |...library |...

Zend Framework: How to add a custom validator path to your entire application?

I have custom validators and filters that I have created that I would like to use throughout my application. All my forms extend a base class. What should I do so that Zend Framework knows where to find these? ...

Zend Framework: How to pass variables to a custom form element's view helper

So I've created myself a custom form element which has a custom view helper. Now I want to be able to set certain parameters/variables on this form element and be able to access them in my element's view helper. How can I do that? Here's an example of what I am talking about: adding the element to the form: $element = new My_Form_Elem...

zend framework: wait for query to finish before starting another

In a web app I've created in zend framework, I'm creating a new database for every new client that registers. This query of course is rather heavy and time consuming since we need to create a database, create some 10 tables and put some data in the tables. We are using one large SQL file that we read in and exec(). After those queries...

Customizing the Rendering of a Zend_Form_Element_Radio

I have an object that's an instance of a Zend_Form_Element_Radio. I'd like to customize how these radio buttons are displayed. The manual remarks Radio elements allow you to specify several options, of which you need a single value returned. Zend_Form_Element_Radio extends the base Zend_Form_Element_Multi class, allowing you to spe...

how to send data from action to action methods in zend framework 1.10.8

Hello Good people i'm trying to check whether my forms(Zend_Form) are being well processed and display whatever back to user, for testing (my way of learning new stuffs).So i've read online that there are 3 ways to accomplish this. one using the Zend_Registry which is unanimously said to be a bad practice.i'm now left with placeholder a...