zend-framework

Zend Framework: Application.ini what does resources.view[] = do?

i am wondering what does adding ... resources.view[] = ... init application.ini actually do? i know it allows me to access the view from bootstrap by $this->bootstrap('view'); $view = $this->getResource('view'); but i wonder how does zf know resources.view = zend view? i guess doing that and accessing $view by getResource('view...

Allow users to download PDFs in PHP5, ZEND, MVC environment

All, I have a PHP5 application written with Zend Framework and MVC style. My application allows multiple users to login and see content based on their privileges. I have a dropdown on the home page. Upon selecting the dropdown, an ajax call occurs which populates the page with a table. Also, it generates a PDF file with the table data u...

PHP > Zend Framework > Zend_Money

Hi I've used Zend_Money to format currency as follow $currency = new Zend_Currency(array('value' => $money, 'currency' => 'CAN', 'format' => 'fr')); // output -> 100,00 $ Which display normally on my local development system (wamp on windows) But when i put it...

Download pdf file from a string using Jquery

All, I have a PHP5 application written with Zend Framework and MVC. On my home page, I want to incorporate the functionality to download a dynamically generated pdf file. The way this is done is: User clicks "download file" link. On Click, an AJAX call occurs to a PHP controller, which takes the form data, generates the pdf and return...

Modular Application Zend Framework 1.10 not see class in default folder model

i have next folder structure zf version 1.10 /application /config application.ini /Forms /Layouts /modules /default /controllers /models manufactur.php /view bootstrap.php bootrstrap.php apllication.ini have next content includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLI...

Using the set redirectUrl methods in Zend Redirector action helper

I'm unit testing some extensions of Zend_Controller_Action in SimpleTest. I want to be able to set a redirect url using the set methods of the Redirector action helper, and then use Redirector's redirectAndExit() method to actually redirect later in the process. This process doesn't seem to be working as I expected from reading the doc...

How to remove headers in an array

All, I have a PHP application that seems to generate the following headers in an array. I wish to remove these headers, so I can set new ones like the one for a pdf download. array(2) { [0]=> string(23) "X-Powered-By: PHP/5.3.1" [1]=> string(23) "Content-type: text/html" } How do I do this, as this doesn't seem to work: var_...

Integrating ZF/Doctrine2: Where do i put my Models/Entities & Proxy classes

if i do integrate Zend Framework 1.10 with Doctrine 2 where do i put my Doctrine Models/Entities and Proxies? i thought of the /application or the /library directories. if i do put in the /library directory tho, will it interfere with ZF autoloading classes from there since the classes there will be using PHP 5.3 namespaces vs PEAR style...

Zend Framework : Get bootstrap resource from anywhere in application

i wonder how do i get any bootstrap resource from anywhere in the application. eg. Zend_Validate, Zend_Auth_Adapter etc? ...

Best practice method to find execution time in Zend Framework

I'm interested in the best/standard way to find the execution time of my Zend Framework app. Currently I'm starting the timer on the public/index.php then registering it in Zend_Registry, for a later call, which the layout then uses to calculate the total time. Is there a better way to do this? I know this isn't even entirely accurate, ...

How to load more than one DIVs using AJAX-JSON combination in zend?

I am learning AJAX in zend framework step by step. I use this question as first step and accepted answer in this question is working for me. Now I want to load more than one DIVs using JSON. Here is my plan. IndexController.php: class IndexController extends Zend_Controller_Action { public function indexAction() { } public fu...

unable to set Error Message for email validation-Zend-form

This is strange. I'm trying to set the error message for my email validation element in Zend form. Other fields are working correctly-but not email-what's up? code bit: $name = new Zend_Form_Element_Text('name'); $name ->setLabel('Name:') ->setRequired(true) ->addValidator('Alnum') ...

Routes on zend modules

Hello, I want to make a kind of alias for my modules: Is there a way to make http://www.example.com/news point to /modules/news/controller/news/->action index. And if i go to http://www.example.com/news/show it automaticly points to /modules/news/controller/news/ -> action show Or do I have to make a route for every single action...

How to preopulate zend file elements

Hi, I have a Zend form like this: $this->setName('Add Job'); $id = new Zend_Form_Element_Hidden('id'); $id->addFilter('Int'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name') ->setRequired(true) ->addFilter('StripTags') ->addFilter('StringTrim') ->addValidator('NotEmpty'); $file = new Zend_F...

Creating own Zend_Auth_Adapter

i am having difficulties creating my own Zend_Auth_Adapter. i am using Doctrine 2 with it also. so far i have ... code below i am getting the error Method "hasIdentity" does not exist and was not trapped in __call() whats wrong? use \Doctrine\ORM; class Application_Auth_Adapter implements Zend_Auth_Adapter_Interface { privat...

Shld authentication be done in Zend_Validate instead of a controller action?

currently, to login a user in Zend Framework, i do something like public function loginAction() { if ($this->getRequest()->isPost()) { $adapter = new Application_Auth_Adapter( $this->getRequest()->getParam('username'), $this->getRequest()->getParam('password') ...

Does Zend_Validate work on filtered/unfiltered values?

i wonder if a Zend_Form_Element has filters attached to it, will Zend_Validate validate the filtered or unfiltered inputs? ...

Problem with model loading in Zend Framework

I have weird problem with zend framework basics. I have simple action in IndexController: public function updateusersAction() { $this->_helper->viewRenderer->setNoRender(true); $this->_helper->layout->disableLayout(); new Application_Model_Users(); } And a model I want to create is defined in application/models/Users.php ...

Zend_Form_Element ignore flag not working?

i learnt that i can set the ignore flag on a Zend_Form_Element so that its ignored when getting values etc. i have $this->addElement('submit', 'btnLogin', array( 'label' => 'Login', 'ignore' => true )); but when i do foreach ($this->getElements() as $elem) { echo $elem->getName() . "<br />"; } it stills includes the...

Rendering Zend_Form errors

say i want to attach errors to my Zend_Form i found out the default decorators for forms do not include errors. so i tried adding my own ... in my Zend_Form class $this->setDecorators(array( 'FormElements', array('Errors', array('placement' => 'PREPEND')), 'Form' )); but if there are no form errors, i get Warning: h...