zend-framework

Automatically joining tables without breaking default behaviour in Zend Framework

Hi everyone, The situation is as follows: I've got 2 models: 'Action' and 'User'. These models refer to the tables 'actions' and 'users', respectively. My action table contains a column 'user_id'. At this moment, I need an overview of all actions, and the users to which they are assigned to. When i use $action->fetchAll(), I only have ...

Call to a member function on a non-object

I'm working through Practical Web 2.0 Appications currently and have hit a bit of a roadblock. I'm trying to get PHP, MySQL, Apache, Smarty and the Zend Framework all working correctly so I can begin to build the application. I have gotten the bootstrap file for Zend working, shown here: <?php require_once('Zend/Loader.php'); ...

How to Use Same Models in Different Modules in Zend Framework?

I am working on implementing Zend Framework within an existing project that has a public marketing area, a private members area, an administration site, and a marketing campaign management site. Currently these are poorly organized with the controller scripts for the marketing area and the members area all being under the root of the sit...

Zend Framework - Is there a script to index static content from Views?

Hi, I'm wanting to add a search box onto my website - which is built using Zend Framework 1.6 - using Zend Search Lucene. The majority of my content is static, and held within Controller Views. Does anyone have a script that can index content from the views, and add them into the Lucene search database so I can search them? Many than...

Zend framework; Getting controller to use different viewer.

I am using the Zend Framework. I have a controller named 'UserController' that has a public function displayAction(). I would like to know how I can get that action method to use a different viewer than the default display.phtml. Any help is appreciated. ...

How to redirect to the requested URI after authentication using Zend_Auth?

Hi everyone, I am using a simple Zend_Auth setup to authenticate users for one of my applications, using a check in the preDispatch() method in a controller plugin. When anonymous users navigate to /users/view/id/6 for example, they should be redirected to the above URI after authentication. What is the best way to do this? I'd pre...

Execute code after HTTP request is complete in PHP?

PHP provides a mechanism to register a shutdown function: register_shutdown_function('shutdown_func'); The problem is that in the recent versions of PHP, this function is still executed DURING the request. I have a platform (in Zend Framework if that matters) where any piece of code throughout the request can register an entry to b...

Attach JavaScript event handler to Zend_Form_Element

I need to attach some javascript to the onchange event of the Zend_Form_Element. How do I do that? ...

Dynamically include .js files from Zend_Controller_Action?

I came across the case where depending on the execution path I may need to invoke an inclusion of .js file from controller. Is there a nice way of doing it? (besides setting some view variable with actual .js include code)? ...

Models in the Zend Framework

What are some of the ways you have implemented models in the Zend Framework? I have seen the basic class User extends Zend_Db_Table_Abstract and then putting calls to that in your controllers: $foo = new User; $foo->fetchAll() but what about more sophisticated uses? The Quickstart section of the documentation offers such an example ...

Is there a way to do an "INSERT...ON DUPLICATE KEY UDPATE" in Zend Framework?

I would like to use "ON DUPLICATE KEY UPDATE" in Zend Framework, is this possible? Example INSERT INTO sometable (...) VALUES (...) ON DUPLICATE KEY UPDATE ... ...

Integrating external scripts with Zend Framework

What is the best way to integrate an external script into the Zend Framework? Let me explain because I may be asking this the wrong way. I have a script that downloads and parses an XML file. This script, which runs as a daily cron job, needs to dump its data into the database. I am using Zend Framework for the site which uses this scri...

Zend Framework Updates?

How long do you normally test an update for Zend Framework before pushing it out into a productions project. We can break this question up into minor updates 1.6.0 -> 1.6.1 or maybe a major update 1.6.2 -> 1.7.0. Obviously you don't release it if it add bugs to your code. Also, as with most other server software updates normally peopl...

Updating Zend_Auth_Storage after edit users profile

Hi, I have following situation: I have loged user, standard authentication with DB table $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); $authAdapter->setTableName('users'); $authAdapter->setIdentityColumn('user_name'); $authAdapter->setCredentialColumn('password'); When user edits his profile, I ...

Where to use Zend Framework translation tool

Hi! I have the whole MVC-Model set up and use HTML views as templates. But I have german strings in there that I would like to translate to other languages at some point. What is the best way to do this? I know I have to use Zend_Translate, but do I have to implement a single call to a translate function for every word that I have in m...

I'm using Zend gdata to open documents with hopes to read and write spreadsheet cells.

I'm not good at programming and my trying to open one of my spreadsheet documents. Below in the basic login im using, I then request a list all my spreadsheet, which is returned in $feed. And now I'm worried I'm not on the right track with opening a document so I can read and write cells. <?php require_once '../library/Zend/Loader.php...

How do detect that transaction has already been started?

I am using Zend_Db to insert some data inside a transaction. My function starts a transaction and then calls another method that also attempts to start a transaction and of course fails(I am using MySQL5). So, the question is - how do I detect that transaction has already been started? Here is a sample bit of code: try { ...

zend framework stack trace

Is there a way to make stack trace to display the whole generated SQL statement when there is an error instead just the first few characters of it? This is what it currently displays ...\Zend\Db\Adapter\Pdo\Abstract.php(220): Zend_Db_Adapter_Abstract->query('UPDATE "diction...', Array) ..and I would like to see the whole update st...

How to use data from Zend_Db_Table in a Zend_Form

I have create a form class for editing deleting and add users to a database. If I want to edit a user how can I simply supply the information of the user to the form. I use a Zend_Db_Table to get the data from the database. This is the userForm class: class UsersForm extends Zend_Form { public function init () { $username...

Customizing Zend_Form

I am dealing with Zend_Form right now and am having a difficult time figuring out how to: 1. Use custom images for form buttons and, 2. Insert text and links in specific places (in my case I want to put a "forgot your password?" link before the submit button). I've read through the manual but am not seeing anything about this. Any direc...