zend-framework

Best practice creating dynamic sidebar with zend framework

What is best practice to create dynamic sidebar or other non content layout places with zend framework. At this moment I created controller witch i called WidgetsController. In this controller i defined some actions with 'sidebar' response segment for my sidebar and in IndexController i call them with $this->view->action(); function but ...

Using Multiple Tables in a Zend Model and returning a combined result set

Hi This is either a very specific or very generic quetion - I'm not sure, and I'm new to the Zend framework / oo generally. Please be patient if this is a stupid Q... Anyway, I want to create a model which does something like: Read all the itmes from a table 'gifts' into a row set for each row in the table, read from a second table w...

How to translate strings in JS

I have a project which I want to translate into multiple languages for the PHP Part I use Zend Frameworks Zend_Translate with GetText. Now I want to translate the JS part too. I am using the jQuery JS Framework and would love to hear your thoughts on translation for JS files ...

Zend Framework with multiple schema/databases?

I have a few tables that I've defined like the below examples: class TableA extends Zend_Db_Table_Abstract { protected $_schema = 'schema1'; protected $_name = 'tablea'; } class TableB extends Zend_Db_Table_Abstract { protected $_schema = 'schema2'; protected $_name = 'tableb'; } ...

Zend_Framework- Where to Place $_GET and $_POST (HTTP Request) handling?

I recently read this post which led to a series of other posts that all seem to suggest the same idea: Models do everything, the View should be able to communicate directly with the model and vice versa all while the Controller stays out of the way. However, all of the examples shown are fairly simplistic and none really show an example ...

Call Multiple Stored Procedures with the Zend Framework

I'm using Zend Framework 1.7.2, MySQL and the MySQLi PDO adapter. I would like to call multiple stored procedures during a given action. I've found that on Windows there is a problem calling multiple stored procedures. If you try it you get the following error message: SQLSTATE[HY000]: General error: 2014 Cannot execute queries ...

Zend Framework: Proper way to interact with database?

I'm fairly new to the Zend Framework and MVC and I'm a bit confused by Zend_DB and the proper way to interact with the database. I'm using the PDO MySQL adapter and have created some classes to extend the abstract classes: class Users extends Zend_Db_Table_Abstract { protected $_name = 'users'; protected $_primary = 'user_id'; ...

Zend Framework: Is there a way to get the path to the view template directory?

I'm just trying to find a way to get the path to the directory of my view templates using the Zend Framework. Is there a way to do that? ...

Always get this error when I use upload images - Using Zend Framework

Warning: include_once(Zend/Http/Client.php) [function.include-once]: failed to open stream: No such file or directory in /home/hotbuzz/public_html/include/Zend/Loader.php on line 83 Warning: include_once() [function.include]: Failed opening 'Zend/Http/Client.php' for inclusion (include_path='/home/hotbuzz/public_html/include;.:/usr/lib/...

Zend_Form radio element

Below is sample code to create a radio button element with Yes/No options in Zend_Form. Any ideas on how to set the required answer to Yes, so if No is selected, it'll fail validation? The code below will accept either Yes or No. $question= new Zend_Form_Element_Radio('question'); $question->setRequired(true) ->setLabel('Are you sur...

I have installed Zend Framework and need to set up include path in PHP?

I have dumped Zend Framework files in "home/hotbuzz/public_html/include/zend/" My hosting : linux I want to load it in my script. Whenever I load I get this error. Some info: I asked about my Zend, to hosting guys they said its located in "usr/local/zend" But I want to use this home/hotbuzz/public_html/include/zend/ I had added ...

Is there anywhere to find a list of what I can set for the form with Zend Framework

I am just starting out with the Zend Framework and I am a little confused but getting there. Anyway I have been reading the documentation for *Zend_Form* and was wondering about setting values for the form such as this: $form->setAction('') ->setMethod('post') setAction and setMethod were the only two options given and I was wond...

Handling input with the Zend Framework (Post,get,etc)

Hi, im re-factoring php on zend code and all the code is full of $_GET["this"] and $_POST["that"]. I have always used the more phpish $this->_request->getPost('this') and $this->_request->getQuery('that') (this one being not so much logical with the getquery insteado of getGet). So i was wondering if my method was safer/better/easier t...

Zend_Db_Table Relationships and Zend_Paginator

Hi, is there a way, hot to apply paginator limit on select, which I send to findDependentRowset function? for example: $select = $row->select(); $select->order('item_name'); $row->findDependentRowset($table, null, $select) thank's ...

Zend_Loader can't find my file?

I am following this tutorial on Zend Forms. I copied it verbatim and I got this error Fatal error: Class 'forms_ContactForm' not found in /Quickstart/application/controllers/IndexController.php on line 10 Which led me to believe it wasn't loading in the class, so I added this into my IndexController.php file Zend_Loader::loadClas...

Zend_Form -> Nicely change setRequired() validate message

Say I create a text element like this: $firstName = new Zend_Form_Element_Text('firstName'); $firstName->setRequired(true); Whats the best way to change the default error message from: Value is empty, but a non-empty value is required to a custom message? I read somewhere that to replace the message, just use addValidator(......

Zend Auth and ACL

Hi there, I am hoping some can help me a little bit, I am currently developing my first site using a PHP framework, part of the site is spilt into a members area, this is where my confusion begins to surface, withing the members area I want normal members to be able to add new comments and edit there own comments, simple enough that I ...

Add RSS auto-detection when using Zend Layout

I've got a site using Zend Layouts and on certain pages I'd like to add RSS auto-detection (adding a <link> in the head section). How do I add this to the layout just on certain pages? ...

Zend Framework Routing: .html extension

I know I've seen this done before but I can't find the information anywhere. I need to be able to route with .html extensions in the Zend Framework. I.E. /controller/action.html should route to the appropriate controller / action. We have an idea to throw away the .html extension with our .htaccess file but I think changing the route c...

Zend Framework: How to display multiple actions, each requiring different authorizations levels, on a single page

Imagine I have 4 database tables, and an interface that presents forms for the management of the data in each of these tables on a single webpage (using the accordion design pattern to show only one form at a time). Each form is displayed with a list of rows in the table, allowing the user to insert a new row or select a row to edit or ...