zend-framework

Fatal Error when using Doctrine ORM with Zend Framework

I am having a little play with an ORM but I am struggling to get off the starting blocks. I am familiar with Zend_Db and was hoping Doctrine would work in a similar way but with more flexibility. I've followed the various tutorials, to integrate Doctrine with Zend Framework, which are available. All these tutorials more or less say the ...

connecting google analytics data api to dojo charts - php backend

I'm looking at feeding dojo charts with data from google analytics, within a Zend Framework app. Has anyone done this or have any overview as to how I would go about it? I see there is a dojox.data.GoogleSearchStore. Does it make sense to have a dojox.data.GoogleAnalyticsStore and is anyone working on something like this? ...

Zend .htaccess configuration not working in Ubuntu

Hi I am running Ubuntu 10.04 LTS - the Lucid Lynx i create a project by zf create project test this command automatically generates a .htaccess file which didn't work I configured my webserver (Apache2) by editing /etc/apache2/sites-available/default file setting <Directory /var/www/> Options Indexes FollowSymLinks MultiViews All...

Illegal Token error while decoding JSON on Zend Framework

Guys, Im running this example given on zendcasts and i seem to be getting a "Illegal Token" error. An error occurred Application error Exception information: Message: Illegal Token Stack trace: #0 /Applications/Zend/Zend Studio - 7.2.1/plugins/org.zend.php.framework.resource_7.2.0.v20100324-1300/resources/ZendFramework-1/library/Z...

Zend DB: joinLeft problem

I am trying to construct this query with Zend DB: SELECT `s` . * , `a` . * FROM `shr_statement` AS `s` LEFT JOIN `shr_answer` AS a` ON a.statement_id = s.statement_id AND a.user_id =1 WHERE (s.language = 'en_US') AND (s.is_active =1 ) ORDER BY `order` ASC I read about a possible issue with t...

Can I cancel a Zend Controller action in the init() method?

During Zend_Controller_Action::init(), is there a way to cancel the action (so it won't be called)? <?php class JsonApiController extends Zend_Controller_Action { function init() { // try JSON decoding the raw request body if ($jsonDecodingFailed) { echo '{"error":"invalid JSON"}'; $this->...

Zend doesn't seem to want to load the form I've created

Hey, I seem to be climbing a pretty horrible learning curve. It's taking me hours to even get to the point where I can structure/write code. I originally wanted to be able to store a form or a model inside its respective module, for example: ./application/module/ModuleName/forms/ClassName.php but when I tried to instantiate a class w...

Zend Framework Nested Checkboxes

I would like to create a Zend_Form with nested checkboxes. I'm sure that it's possible, but I don't remember how to do it. This is what it would look like: [x] Top level checkbox 1 [ ] Sub level 1 [x] Sub level 2 [ ] Top level 2 [ ] Sub level 1 [ ] Sub level 2 How would I achieve this result? ...

MVC + ORM, generating reports

I've just started using Zend Framework and Doctrine as its ORM, and I have some doubts regarding the model. It's obvious that the purpose of the ORM is just to map my domain model to database model, but I'm curious how you would model various reports needed on a Web application? From my point of view, and correct me if I'm wrong, I shou...

Prevent Sql injection in ZF

I use following code $this->getDb()->fetchRow($sql, $params); Is it free from sql injection? Please guide me. How i can make it free from sql injection. ...

ZendFramework - Finding out what queries are being run - Easier way

Hi There, Was wondering if there is an easier way to see the queries are being being run by my models? I know the alternate options are xDebug and Firebug but was wondering an easier method. Anyone? Thanks ...

How to self-initialize Doctrine_Record (as if Doctrine_Query would)?

Hi, I have models that extend Doctrine_Record, and are directly mapped to one specific record from the database (that is, one record with given a given id, hardcoded statically in the class). Now, I want the specific record class to initialize itself as if Doctrine_Query would. So, this would be the normal procedure: $query = new Doct...

Zend_Form_Element_Hash problem (unclear documentation?)

It is written in the documentation that it is enough to include the Zend_Form_Element_Hash element in a form and that CSRF protection is handled automatically by Zend_Form. I have added the token like this: $token = new Zend_Form_Element_Hash('security_token_against_csrf'); $token->setSalt($this->_helper->randomString()); $form->addEle...

Zend Framework Widget Tutorial question

I try to follow this tutorial, but I can't get it to work: http://weierophinney.net/matthew/archives/246-Using-Action-Helpers-To-Implement-Re-Usable-Widgets.html I did everything as described, but I don't know how to make it available in my controllers. My filesystem looks like this: - application - controllers - IndexCont...

How to strip unused parameters from the url?

I'm using Zend Framework and the URL View Helper to create URLs I have some lines like this in my navigation: $this->url(array('controller' => 'index', 'action' => 'index')) $this->url(array('controller' => 'who', 'action' => 'view', 'id' => $row->who_id)); $this->url(array('controller' => 'projects', 'action' => 'view', 'id' => $row->...

Zend viewRenderer->setNeverRender();

Hi, I am basically trying to export from ZEND to csv as described http://stackoverflow.com/questions/1136264/export-csv-in-zend-framework and use the $this->_helper->viewRenderer->setNeverRender(); unfortunately the plugin code is still contained in the csv file. Any clue why? public function indexAction() { $this->_helper->lay...

Zend application and bootstrap as non mvc

Is it possible to use zend_application and zend_bootstrap as non mvc? I'd like to use them but without the zend_view. ...

Find out which Zend Framework module loads CPU up to 200%

In my Cpanel account in Daily Process Log I can see that my zend framework application load CPU very much Top Process %CPU 182 /usr/bin/php /home/*******/public_html/index.php But any requests to ZF application goes by index.php (with rewrite rule for Apache) Is it possible to find out what request (url) load CPU? ...

How to stub data for PHPUnit with plugin using Zend_Auth that redirects on failed authentication

I'm still a newb to phpunit so I hope to be explaining this correctly. I'm trying to run a controller test with PHPUnit, however the plugin that is using Zend_Auth is redirecting back to the login. How do I create the stub data? I tried placing it in my setUp but Zend_Auth appears to be reinstantiated after setUp. Thanks for any help ...

Models in Zend Framework

Hi, I am new to zend framework. I have created "models" folder in application directory. Inside models folder I created a class Application_Models_Albums which extends Zend_Db_Table_Abstract. Now when I use the following code in IndexController. I get error: $albums = new Application_Models_Albums(); $this->view->albums = $albums->fet...