zend-framework

storing and loading cart in the database

I am coding a E-commerce website/admin interface for a client. They are doing some B2B so they want the cart to be saved/loaded from database so if the user close his browser and reopen it the cart is intact. The application is using the Zend Framework and I've been looking to the Zend_Session_SaveHandler_DbTable. So I can save the ses...

Pagination in Zend

riends, I want to create pagination in Zend.I'm a newbie in zend.Please help me index.phtml is given below <table> <tr> <th>Name</th> <th>Quantity</th> <th>&nbsp;</th> </tr> <?php foreach($this->orders as $order) : ?> <tr> <td><?php echo $this->escape($order->name);?></td> <td><?php echo $this->escape($order->quan...

Zend Framework - JQuery - Ajax update on Select element change

Hi, I am pretty new to the zend framework and the JQuery helper. I have been playing around with the ajaxLink method, and was wondering if there's a way to adapt it to use it in a form. Let me explain: I want to add an "onChange" attribute on a "select element" in a form. When the select element is changed, I would like to have an aja...

How can I access static assets in a Zend Framework Module?

In a Zend Framework 1.10 application, I have a controller UsersController in a module api and in the index view of that controller I would like to reference a static asset (like a javascript file). How can I do that without putting the file in the main public? so, we have a directory setup like this: zfproj/ ../applicati...

Is there a way to generate views from Zend_Form ? (read-only)

I was wondering if is there an easy way to generate views from form objects when dealing with CRUDs. I mean, when we have these options: VIEW | EDIT | DELETE I want my VIEW option like EDIT option, but without form elements, just the values. This will minimize so much the time spent to create these views. Someone knowks something like...

How to do preDispatch forwarding in Zend Framework?

I want to use _forward() in preDispatch after checking if the user is logged in in every controller. The scenario is quite easy: If the user is not logged in, it should be forwarded to loginAction either in the same controller or in another controller. This would cause an infinite loop, as the dispatch process starts over again, callin...

Pagination in Zend

I'm trying to create pagination.so I create a 'pagination.phtml' and stored it in 'views/scripts/' and add the given line in my index.phtml '$this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml');. pagination.phtml code is here <?php if ($this->pageCount): ?> <div class="paginationControl"> <!-- Previous page lin...

Zend framework - not entering values in database - garbage going in

Hi guys I'm in an emergency here. My code was working FINE for a while when ALL of a sudden somethings gone wrong and I havent a clue what! I store an object in my database by serializing it and then running a base64_encode on it. The result is an encoded serialised string which when I wish to retrieve I just decode and unserialise it. ...

Using HTML Entities in a Zend Form Select

I am populating a Select form element, and if I try to use HTML Entities in the value, it get's converted, rather than displaying the special character. This code: $form->field_name->addMultiOption('value', '&nbsp;&bull; label'); Renders: <option value="one">&amp;nbsp;&amp;bull; label</option> But I want it to be: <option value="...

Best way to change default homepage in Zend Framework

Hi all, Right now ZF defaults to / I would really like / to redirect to /sort/all I've changed my default route in routes.ini to routes.default.route = "/:controller/:filter" routes.default.defaults.controller = sort routes.default.defaults.action = sort routes.default.defaults.filter = all which displays correctly but the URL ...

How to get the affected rows of the Zend_DB_table?

After you do get the number of rows affected when you do $table->delete($query) does it return the number affected rows?? ...

Loading "custom resources" in Zend Framework 1.10

Everything was working fine in 1.9.6. I changed to 1.10 and now I have a lot of Warning for basically every Application Resource. It looks like the ZF is looking for Application Resources in the "custom resources" path that I set up from: pluginpaths.App_Application_Resource = "App/Application/Resource. Is there any way to avoid this!?...

How to limit file upload speed in php or apache?

I'm doing some form in Zend Framework for file upload on "Apache friends - xampp" server 1.7.1 on Ubuntu 9.10. My problem is that I what to add progress bar for this upload and since xampp server is on my localhost, file uploads are very fast. As a result, I have no time to check or observer if progress bar works as it should. Is th...

Show login form on every page using Zend Form.

Hello there... I cant seem to figure out how to create a flexible sidebar containing and login form (Zend_Form) and various module/controller specific links. The most common solution seems to be using: echo $this->action('login', 'authentication', 'default'); But apperently this isnt the 'best' way? I've read that this apprently tri...

Zend Framework - long routes(Router)

I'm already thinking about to start using simple GET string. Or I'm not so good at configuring routes? :) And configuring routes via regex in .htaccess foreach($links as $a) { $Router->addRoute($a['link'], new Zend_Controller_Router_Route( $a['link'] . '/:page/:ad_id/:photo/:price_from/:price_...

Doctrine can't find a connection after Zend Framework redirect

I have some troubles with Doctrine integration into ZF. After simple redirect $this->redirector->setGotoSimple("asd"); Doctrine returns Doctrine_Connection_Exception: There is no open connection in /Users/insight/Sites/max/library/Doctrine/Manager.php on line 657 if i try to get this "asd" page directly or press f5 at the err...

how do I push variables onto web client for ajax?

Hey guys How do I use the PHP variable $contact['id'] in my ajax call? I'm trying to create a page that retrieves all notifications associated with a user. When the page load I already know the id of the user, how do I use this parameter in my ajax calls from the beginning? At the moment I am using the php preprocessor by splitting up th...

Zend_Form custom decorators cause blank page

HI, I am trying to use custom decorators with Zend_Form. I created custom decorator and used teh following code $form = new Zend_Form(); $form->addElementPrefixPath("Moon_Form_Decorator","Moon/Form/Decorator/","decorator"); $form->setAction("/question/index/ask-process")->setMethod("post"); $title = new Zend_Form_Element_Text('titl...

Need to setup cleaner links - currently links too long - Zend framework

Hi guys, I'm using the zend framework for my project - I've tried to set up using clean links - however I've noticed that my links seem to be getting really really long and wonder if at this point there would be a way to incorporate a structure where I could user smaller links. Heres an example my website has a directory controller, whi...

Zend Framework plugins/modules

The symfony framework has a lot of plugins for adding functionalities like a user system (login, registration, authentication, etc..), so users won't have to invent the wheel from scratch, as a user system is a basic need for most applications (for example). I have tried finding an equivalent in Zend Framework, and though there is the c...