zend-framework

MVC (PHP): Do Controllers/Actions map to each and every request?

I've been getting to grips with MVC (in PHP) by way of Zend. My understanding of the Zend Framework is that each type of user request maps to a specific controller (which in turn may or may not map to a model), and each action maps to a view. I've noticed the same pattern in Codeigniter and Kohana, and to some extent also in Symfony. Eff...

How to retrieve the Zend_Config used by Zend_Application?

I'm migrating my app to use Zend_Application for bootstrap. I used to have the Zend_Config as a key for my $registry. Now I don't know how to use it this way anymore (without having to reload the config file). I know it's possible to use $application->getOptions(), but that gives my an array and I would have to change everywhere in my c...

Is Zend Framework a total waste of my time?

Ok, I'm about 50% done with the "30 minute" quickstart guide from Zend. I must be missing something, because this seems like a total waste of time. The point of this quickguide is to create a guestbook, something I could do in 5 minutes with regular naked non-framework php. Here's my path to zend framework: c:/program files/wamp/www/_z...

same password for multi-users in zend

I have the following scenario in zend framework: Data Table of students Table of classes, which contain many students each. Table of assignments, each of which is assigned to a class and given a password I want students to be able to access an assignment given that assignment's id and shared password, but for the application to note wh...

Zend Framework - Set 'selected' value in select box dropdown list

I am adding a select element to a Zend_Form instance as follows: $user = $form->createElement('select','user')->setLabel('User: ')->setRequired(true); foreach($users as $u) { if($selected == $u->id) { $user->addMultiOption($u->id,$u->firstname.' '.$u->lastname); //*** some way of setting a selected opt...

Zend_Layout display Login or Navigation

Hi, iam not sure if iam doing it the right way. My Goal is to display in my Layout an Login or an Navigation at the header section. My implementation looks like this (without logic): 2 Layout scripts: login.phtml navigation.phtml An FrontController Plugin: class Plugin_Header extends Zend_Controller_Plugin_Abstract { /**...

Can (and should?) Zend_Auth return class as the Identity?

I have a class R00_Model_User, which, curiously enough, represents user as he is. Can $result->getIdentity() return me an object of this class? (Or maybe it's stupid?) (There is a factory method in R00_Model_User which prevents from duplicating objects. I'd like Zend_Auth to use it instead of creating a new object, if it can) ...

Simplest model code

I am very experienced with the CakePHP framework but am checking out the Zend Framework for an application that will receive massive traffic. I'm going through the quickstart tutorial in the documentation and got to the "Create a Model and Database Table" page. Must I or should I create all those model classes it mentions, i.e. applic...

Custom routes and i18n

I am very experienced with the CakePHP framework but am checking out the Zend Framework for an application that will receive massive traffic. I need to set up some non-standard routes and add in i18n (url-based) and have seen some parts of the reference documentation that refer to this, and creating Registry keys etc, but I've not found...

Zend Framework subdomain problem

Hi, I am using .ini file to add routes in my application. resources.router.routes.username.type = "Zend_Controller_Router_Route_Hostname" resources.router.routes.username.route = ":username.example.com" resources.router.routes.username.defaults.module = "userinfo" resources.router.routes.username.chains.index.type = "Zend_Controller_Ro...

How to access URL parameters in bootstrap

Hi you all: I'm trying to capture a URL parameter in my bootstrap file but after several attempts I'm not able to do it. I've tried this but it does not work: protected function _initGetLang() { $frontController = Zend_Controller_Front::getInstance(); $lang= $frontController->getParam('lang'); } Is this the right way to do it? ...

Zend_Dojo_Form onSubmit

I have a contentPane with a remote form, I'm trying to get the form to submit, and stay within the pane, either displaying the form again on error or reporting success. I'm sure this is easy but I'm stumped, not the first time and not the last I'm sure. Store Form : class Services_Form_Store extends Zend_Dojo_Form { protected ...

Can we lock tables while executing a query in Zend-Db

I am talking about doing something like this: LOCK TABLE page WRITE; SELECT * FROM page WHERE col = 'value'; INSERT INTO page(col1, col2) VALUES('val1', val2); UNLOCK TABLES; ...

Using Zend Framework with CodeIgniter in XAMPP problem

This article explains how to use Zend in Codeigniter.http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/ I am using XAMPP and having difficulties with path. Could anyone explain the followings please. Q1. I am not sure what is going on here. Why do I need to set this one? ini_set('include_path', ini_get('inc...

Architecture of a PHP app on Amazon EC2

I recently experienced a flood of traffic on a Facebook app I created (mostly for the sake of education, not with any intention of marketing) Needless to say, I did not think about scalability when I created the app. I'm now in a position where my meager virtual server hosted by MediaTemple isn't cutting it at all, and it's really comin...

How to work with multiple word resources in Zend_Tool

So I've got a controller that I want to be camel cased: MisterFoobarController So I created it like this: zf create controller mister-foobar which created something like Mister-foobarController.php but inside of it created it correctly as MisterFoobarController. How do I create camel cased multiple word resources with the Zend_To...

zend set/getScriptPath problem:

I'm working my way through the Apress book "Beginning Zend Framework" - and am struggling to get one of the examples to work. The aim is to circumvent the standard directory structure using setScriptPath. Rather than storing the action's associated view script in the scripts directory, the tutorial asks you to save it elsewhere in the ...

SVN externals and export for framework

I'm currently working on a framework for a client. The framework is based upon Zend Framework. The directory structure is: application : Application specific code application/modules/frontend : Application specific code application/modules/backend : Backend for MyFramework library/MyFramework : The custom...

Zend Form Field Mapping To DB Columns

I have a Zend_Form $form = new My_Form(); $uploadedData = $form->getValues(); Zend_Debug::dump($uploadedData, $form->name,true) and when i dump the form values i get a string array array(11) { ["event"] => string(2) "26" ["firstname"] => string(3) "sdf" ["surname"] => string(0) "" ["gender"] => string(1) "M" ["company"] => ...

Zend Framework asking for view script despite setNoRender

I've made an API controller with some actions to spit out JSON for my app and I've turned off the layout and view renderer in its init() method so I've got no view scripts for this controller. I'm trying to use my apiController::treeAction elsewhere in the app via an actionHelper to output some JSON inline. I can access the action direc...