zend-framework

Zend_Paginator and cache. How can I read the datas that I have sent to cache

I register the data to cache and I see the foliowing : zend_cache---Zend_Paginator_1_42242d5fa3c4e4b7758810c276163e8a but I can't read. $request = $this->getRequest(); $q = new Model(); $paginator = Zend_Paginator::factory($q->fetchAll()); $paginator->setCurrentPageNumber($request->getParam('p')); $paginator->setItemCountPerPage...

Can I use my normal (html) form in Zend Framework ?

Can I use my normal (html) form in Zend Framework ? How can I do that & How can I call action in IndexController file? ...

Invalid parameter number: number of bound variables does not match number of tokens

I have a table: 'objects' with few columns: object_id:int, object_type:int, object_status:int, object_lati:float, object_long:float My query is : $stmt = $db->query('SELECT o.object_id, o.object_type, o.object_status, o.object_lati, o.object_long FROM objects o WHERE o.object_id = 1'); $res = $stmt->fetch(); Pdo throw error: SQLSTATE[...

Why is Magento trying to call in the Mage namespace rather than my custom namespace?

I’ve created a module within the local code folder in our custom namespace. The block isn’t displaying on the frontend, and on checking the exception log, it turns out Magento is looking in the wrong place. exception ‘Mage_Core_Exception’ with message ‘Invalid block type: Mage_MyCompany_ForthcomingProducts_Block_List’ in /var/www/html/...

zend form decorators

Having (more) issues with zend form decorators. I've got this so far: Reset overall form decorator: $this->clearDecorators(); $this->setDecorators(array('FormElements', 'Form')); I'm adding all my elements to a display group that i want to be inside a fieldset, within a DL $group->setDecorators(array( 'FormEle...

Zend-studio does not recognize my Zend_form class insde my admin module

In my application all works fine. But in zend studio, I got an alert saying that my Admin_Form_... does not exist. If I put this form in root of application folder (application/forms) I can use autocompletion and my class is regonized. But if I put in a module specific directory, it is as if my class didn't exists. What should I do to ...

How does Module bootstrap work for default module?

I've setup my application with two modules, one for Admin and other for the rest of application called default. Then I've created a Bootstrap file for Admin module, and when I've tried to set the bootstrap for default module I've got an inifite loop and my apache crashes. I'm not sure if I completely understand the bootstrap dynamics. O...

Zend framework: what is the right place to validate user input?

I want to add a user in users table via link like '/index/adduser/id/7' . Question Should I validate user input inside 'adduserAction' function inside controller or somewhere inside model file? I've put files containing database related functions inside 'models' directory. Suppose a user is added to a table via 'id'. This id is sent vi...

ZEND currency symbol is displaying 1

I'm using zend currency to display the currency based on locale. When I use the following code the symbol gets replaced by 1 instead of simply being removed: $currency = new Zend_Currency($locale); $currency->setFormat(array('symbol' => Zend_Currency::NO_SYMBOL)); What normally gets returned is this: € 2.500,01 but after the "setForma...

How to create a checkbox tree filled from database using Zend_Form ?

How do I do that with Zend_Form? <ul> <?php foreach ($this->roles as $module => $resources): ?> <li> <?php echo $module; ?> <ul> <?php foreach ($resources as $resource => $privileges): ?> <li> <?php echo $resource; ?> <ul> <?php foreach ($pri...

Soap server error

I get the following error when setting up an Soap server with Zend Framwork. SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in 'http://manager.sander.dev.vije.local/butler/service/soap/wsdl/1' The link from the error seems to return the correct XML: <definitions name="Espire_Product_Butler_Soap_Server_BusinessManager" targetNa...

Zend_Db order by field Value

I'm outputting the contents of a select menu from a model using this: $select = $this->select(); $select->order('name'); return $this->fetchAll($select); However, what i want to do is order by a specific value, and then by the name column. The SQL would look like this: SELECT * FROM `names` ORDER BY `name` = 'SomeValue' DESC,`name` ...

Something wrong with include_path in Zend Framework

Getting this error: Fatal error: require_once() [function.require]: Failed opening required 'db/db.php' (include_path='/home/domain.ru/testerier/sites/application/../library:/home/domain.ru/testerier/sites/library:.:/usr/local/lib/php;/home/domain.ru/testerier/sites/application/models') in /home/domain.ru/testerier/sites/www/index.php o...

imagepng - creating in /public folder

How can I specify filepath to imagepng function? It always seems to create the file in "/public" folder when used in an MVC Zend Framework and even when an explicit filepath is supplied. Is it because of the rewrite rules I have? My .htaccess rewrite rules are as under: FileETag none <IfModule mod_expires.c> ExpiresActive On ExpiresDefa...

How to put if,elseif,else statements while building sql in Zend_db_Select

For example: if(!empty($this->_request->getParam('gadi_from'))) {$select->where('a.gadi > ?',trim((int)$this->_request->getParam('gadi_from')));} if(!empty($this->_request->getParam('gadi_to'))) {$select->where('a.gadi < ?',trim((int)$this->_request->getParam('gadi_to')));} But the problem is, it's isn't working that way. :) I'm get...

Zend Framework, The best way to implement layout...

Hello Friends, I'm learning ZF for two weeks so far. Like it so much. I'd like to ask, what is the best practice for layouts? I got one layout and I need to include few variables for it. Do I need to do this in every controller? The second question is about hiding one part of the layout. Currently I'm doing this as following: if(Zend...

Zend_Filter_Input filtering not triggering

I'm using Zend_Filter_Input on my magic getter / setter methods to validate my input and cast fields to the type I desire. The validation portion is working great, but it's like the filters aren't triggering at all. Here is the relevant logic from my model: public function getFilters() { $filters = array( '*' ...

Creating a more flexible view in Zend Framework

Given an html/javascript 'widget' which needs to have certain fields customized before use. For example, the css class ids need to be unique as the widget may appear more than once on the same page. Let's say I want to keep the markup (js/html) of the widget stored as a template so that I can fill in the values that need to be customiz...

PHP/JS: How to implement dynamic breadcrumbs? (multi-window/tab compatible)

Hi, I'm working on a site where we need "dynamic" breadcrumb generation. Pages within this application are not specific children of the other, so when the user is browsing one of them, I can't simply retrace steps back up. I could have the following breadcrumbs-like lists: (updated) * inbox > message > user profile * search results ...

Updating single database cell in Zend Framework Model

Simple one hopefully, is there a specific way i should be updating a single database value using a model in Zend Framework. I currently do this: class Model_MyModel extends Zend_Db_Table_Abstract { $_name = 'table'; public function updateSetting($id,$status) { $data = array( 'status' => $status )...