zend-framework

Refactoring a Zend_View_Helper_Action widget, utilizing Zend_Controller_Action_Helper_FlashMessenger, into a model

I've tried to create a login widget that can be included at will in any action that is outside the content of the application that requires login. My thought here was that I wanted a DRY-approach for rendering the login box with any error messages from a previous login attempt. To enable this I utilized the FlashMessenger for saving the ...

correct usage of Zend_Db

Hi, I'm currently using the Zend_Db class to manage my database connections. I had a few questions about it. Does it manage opening connections smartly? (eg, I have a connection already open, does it know to take use of it - or do I have to constantly check if theres' already an open connection before I open a new one?) I use the foll...

[ZendAMF for Flex, PHP] Can ZendAMF have private members?

I've worked with AMFPHP for a while, but with Adobe supporting ZendAMF, I was wondering if I should migrate. One of the major disadvantages for AMFPHP is that class mappings need to be public, so not only does that mean public members on the PHP side, but also on the Flex side. I was wondering if it is the same case for ZendAMF. ...

Integrate Doctrine with Zend Framework 1.8 app

I'm interested in using Doctrine as an ORM for a new Zend Framework app I'm writing. I'm trying to figure out the best way to integrate it as straightforward as possible. Every example I find is different, and a lot of them pre-date the new autoloading features in ZF 1.8. None of them have worked for me yet. Does anyone have a good way ...

Using modules in ZendFramework 1.8.2

I'm trying to use modules in the ZF 1.8 project but can't get working routing to modules' actions. Here is an example, I create route "/test" that points to module 'test', controller 'ttt' and action 'index': $router->addRoute( $name, new Zend_Controller_Router_Route('test', array('controller' => 'ttt', 'mo...

avoiding MySQL injections with the Zend_Db class

Hi - I currently use Zend_Db to manage my queries. I've written already code that preforms queries like the one below: $handle->select()->from('user_id') ->where('first_name=?', $id) ->where('last_name=?', $lname) I've done this without sanitizing the input, assuming Zend_Db will. Does Zend do th...

Zend_Uri_Http generates "inet_pton(): Unrecognized address" error

In our application, the backend is accessed via Zend_XmlRpc. In the backend, I'm using Zend_Http_Client together with Zend_Http_Client_Adapter_Curl to connect to another web service over HTTPS. During unit tests, everything works as expected and the remote service is accessible. But when the frontend connects via Zend_XmlRpc to the back...

Relationships in Zend_DB_Table_Abstract

I'm using the default framework code that was created with the Zend Framework Application tool, I added some autoloader magic so that any classes named Default_<*>_<*> would automatically be loaded from the correct directory, in this case Default_Model_TableName. application/models/ProjectCategories.php: <?php class Default_Model_Proj...

how do I insert output from othermodules/controllers in a view

I have a view and I want to display data that would be generated by othe modules and controllers on the page. What is the best way to do this? For example: If on a certain page I want to pull in the latest news from the news module. ...

Why am I getting a router error for a static route?

I have in my bootstrap public function initRoutes() { $router = new Zend_Controller_Router_Rewrite(); $route = new Zend_Controller_Router_Route_Static('register', array('module'=>'members','controller'=>'register','action'=>'index')); $router->addRoute('register',$route); } and when I go to http://domain.com/register I ge...

In Zend Framework how do you wrap form elements in a label using decorators?

I would like to wrap form elements with labels as such <label for="email">E-mail <input type="text" name="email" id="email" /></label> The only option I could find is to alter the placement; however it only accepts 'prepend' and 'append': <!-- prepend --> <label for="email">E-mail</label> <input type="text" name="email" id="email" />...

recommendation for a php validation framework

Hi I'm validating allot of fields now in PHP, and I have to preform basic (string length ect.) and more complex (strip <> tags, for example) Can anyone recommend a class that does this, or maybe a framework, or maybe some functions that do these things? ...

Zend_db & Zend_paginator - Not having a fun time

I am having a serious problem converting my 'select' statement into something that will work with the zend paginator... could someone have a crack at it, as I am having no luck... Here is my query: $query = "SELECT user_id, name, gender, city, province, country, image_id, one_liner, self_description, reputation FROM ...

Is there a way to get the number of records from a query with Zend-framework?

Given my generic select below, is there a way to get the number of records returned from a query with Zend Framework? $row++ in a loop is not acceptable for my solution as I am using paging (though its not in my sample). I also DO NOT want to add another query with "Count(*)". $query = "Select * from Users where active = 1"; $stmt = $...

Strangler Application implementation with ZendFramework

I have current PHP codebase written in procedural (mainly) style that our client is using for some time now. What we want is to "strangle" (as in concept Strangler Application) that code and add Zend Framework to enable new development. What I have now is custom route that routes all "old" HTTP request to one controller (i.e. Strangler ...

Zend url view helper - keeping existing params in a reversed route

At the moment in my ZF project have a URL structure like this: /news/index/news_page/1/blog_page/2 When I generate my pagination I use the URL helper as follows: <?php echo $this->url(array('blog_page'=>3)); ?> Which generates a URL like this: /news/index/news_page/1/blog_page/3 What I'd like to do is use a custom route to have ...

Why when printing GBP symbol using Zend_Currency I get an accented A returned??

Hi, I have a a strange problem that I can't seem to identify the cause of. When I use Zend_Currency to format a value to to GBP I get an accented A before the £ symbol. If ask it to return any other curreny such as USD the accented A disappears. The code that is generating this is: $currency = new Zend_Currency('en_GB'); $amount = $...

Zend_Validate_Between strange error message

I am experimenting with the Zend_Validate_Between class. I set it up thusly: $scoreBetweenValidator = new Zend_Validate_Between(-3, 3, true); so the validator should only accept values between -3 and 3, inclusive. On an invalid value I got a '%value%' was not found in the haystack error message, which I think belongs to the Zend_Val...

set zend framework action controller

hi all, i want to set my action controller from within a hidden filed in my view script form and when my form submitted zend framework router diagnose the action. like this: ...

How does the backend look for AjaxLink() call in Zend Framework

I'm trying to make some ajax-functionality in my web application, but I cannot get all puzzle pieces to fit: I want to add a link that, when clicked upon, will open a new input (text) field that can be filled by the user. In the back-end, I want to do some administration that the link is clicked. I want to do according to the Zend Fram...