zend-framework

How can I print a locale aware date using Zend_Date?

I'd like to use Zend_Date to print out the previous 2 months and year as a string e.g.: July 2009 June 2009 I need it to be locale aware so that if the code runs with the locale set to, say, German, the month names will print in German. $date = new Zend_Date(); $date->subMonth(1); echo $date->get(Zend_date::MONTH_NAME).' '.$...

How to bootstrap Zend_Test_PHPUnit_ControllerTestCase with Zend_Application?

I am used to writing unit tests in Zend Framework 1.9 using PHPUnit_Framework_TestCase for my application. Now I am trying to write a unit test based on Zend_Test_PHPUnit_ControllerTestCase by using the bootstrapping by Zend_Application of Zend Framework. But I am unable to get it running. Here is my nonworking example: class FamilyCo...

Zend Framework + Uplodify Flash Uploader Troubles

I've been trying to get the Uploadify flash uploader (www.uploadify.com) to work with Zend Framework, with no success so far. I have placed all Uploadify files under /public/flash-uploader directory. In the controller I include all required files and libraries like this: $this->view->headScript()->appendFile('/js/jquery-1.3.2.min.js')...

Zend_Navigation url generation issue

I use Navigation component for site menus. I also use let zend figure-out the selected menu item from request parameters - I guess this is done automatically. The only problem is, that for this to work, action and controller have to be specified in navigation configuration for every node. This also means that when zend generates links fr...

Adding sub domain based routes in Zend framework

Hi, I am newbie to Zend framework, I am using .ini file to add routes in my application. I have 2 routes for different modules which resources.router.routes.news_view.type = "Zend_Controller_Router_Route_Regex" resources.router.routes.news_view.route = "([0-9\-]+)/([a-zA-Z0-9\-]+)\.html" resources.router.routes.news_view.defaults.mo...

Writing a subquery using Zend DB

Hi I am having some problems turning the SQL below into a Zend Db query. $select = ' SELECT s.id, i.id as instance_id, i.reference, i.name, i.sic_code, i.start_date FROM sles s JOIN sle_instances i ON s.id = i.sle_id WHERE i.id = ( SELECT MAX(id) FROM sle_instances WHERE sle_id = s.id ) ORD...

Zend Framework 1.9.2+ Zend_Rest_Route Examples

With the introduction of Zend_Rest_Route in Zend Framework 1.9 (and its update in 1.9.2) we now have a standardized RESTful solution for routing requests. As of August 2009 there are no examples of its usage, only the basic documentation found in the reference guide. While it is perhaps far more simple than I assume, I was hoping those ...

How to have multiple join constrains in Zend_Db_Select

Hi, How can I do a join such as : LEFT JOIN table1 t1 ON t1.foo = t2.bar AND tl.baz = t2.bat What I'm looking for is the syntax for adding a second join constraint to the leftJoin() method using Zend_Db_Select in the Zend Framework. Thanks, ...

Zend and web hosting - subdirectory appearing as root

I have learned how to create a simple website with the Zend Framework. Now suppose I want to put it on some web hosting server. In my ZF project, I have a folder named public, which I want to appear as the root of the URL. I want my site to be visible and accessible as http://www.mysite.com while being served from a page like /public/i...

Zend_Amf and Actionscript 2

Anyone know if Zend_Amf (1.9) can talk to Actionscript 2 which uses the Amf0 specification? All the examples in the Zend docs are for Actionscript 3. ...

Disable escape in Zend_Form_Element_Multicheckbox

I'm working with the Multicheckbox element and trying to figure out how to disable "escape" in the FormMulticheckbox helper. I've managed to send an escape parameter to the "description" helper, and that works fine (see "escape" => false below): $this->setDecorators(array( "ViewHelper", "Errors", array(array("internal" => "H...

Read-only delete problem Zend Row

What causes a row (Zend_Db_Table_Row) to be set to "readOnly?" I'm having trouble deleting rows in a loop: // this is set to some integers $ids = array(); // get the results $results = $table->fetchAll($select); foreach ($results as $result) { $value = $result->value; if (!in_array($value, $ids)) { // throws a "row...

Changing the template code produced by Zend_Tool

This is a silly little thing, but I was just wondering whether there was a way to change the style of the code produced by the Zend_Tool? Specifically, the bracket style? // from this: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { // to this class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { Obviously it'...

About general logging, caching and performance in new framework

Hi there. I am creating a new PHP framework depending on Zend Framework. It will be a general purpose MVC framework for web development. I am worried about 2 aspects: Logging: Should I use logging? Is there any substantial performance problems when using logging? Caching database queries: I am caching some queries from database. I am c...

Zend Framework Form Irrational Behaviour

Let's start this off with a short code snippet I will use to demonstrate my opinion: $title = new Zend_Form_Element_Text('title', array( 'label' => 'Title', 'required' => false, 'filters' => array( 'StringTrim', 'HtmlEntities' ), 'validators' => array( array('StringLength', false, array(3, 100...

File Upload In Zend

Hello to all. I have a Zend form with some elements like this : http://i27.tinypic.com/ogj88i.jpg I added all element using this way: $element = $this->CreateElement('text','lockerComb'); $element->setLabel('Locker'); $element->setAttrib('class','colorbox'); $elements[] = $element; $element = $...

How to make parameter optional in Zend Framework Router

Hi, I would like to know the .ini config file setup to make a route wherein the page number parameter is optional so that http://news.mysite.com/national http://news.mysite.com/national/1 point to the same page. I have the code as follows resources.router.routes.news_list.type = "Zend_Controller_Router_Route_Regex" resources.route...

How to use MySQL functions when building a query with Zend/PDO

I'm using Zend Framework with the PDO MySQL adapter and I want to use a function in my insert statement. Basically, the SQL I want to generate is this: INSERT INTO `myTable` (`leftId`, `rightId`, `date`) VALUES ($left, $right, NOW()) This is the code in my Model: $data = array( "leftId" => $left, "rightId" => $right, "dat...

Example for Zend_Navigation and Menu + Submenu

Hi Folks, i want to create an Menu with Zend Navigation, with this markup : 1. Food 1.1 Drinks 1.2 Fruits 2. Cloths 2.1 Shirts 2.2 Shoes Filled from two DB tables : main_category / sub_category. But i can understand the documentation, possible to complex for me litte brain. If someone has an example for Zend Navgation feel free to ...

Zend Framework - Active Record + Form Generation + Validation?

I'd like to use an Active Record design pattern in a few of my projects and I'd like to have the models, validation and form generation set up for me. Symfony is really nice for this, as is the framework I use in my day job. Is Zend Framework able to do this for me, or do I have a lot of legwork to do myself to get ZF tied in with and O...