zend-framework

Strange problem with PHP and sessions

So the basis of this page is I set a session value when the page loads, and clear it on any other page they visit. Then the page can make an ajax call to download a file. If the session value matches the value I pass through the URL I allow them to download the file. If not I return a 404 error. I was having some weird issues, so I r...

Zend Framework Module Based Error Handling

Zend_Controller_Plugin_ErrorHandler always forwards to ErrorController::errorAction() in the default module but i want it be module aware. For example when a exception throws it must be call the module's ErrorController like Admin_ErrorController:errorAction. How can i do this? Thanks. ...

Zend Framework: view var set in bootstrap not accessible in view scripts?

I've set a view var in bootstrap file like this: protected function _initVars() { $this->bootstrap('layout'); $layout = $this->getResource('layout'); $view = $layout->getView(); $view->theme = 'MY_THEME'; } My application.ini has following line as well: resources.view[] = But inside view scripts, <?php echo $this->...

valitade zend framework's output

I use xhtml1-strict.dtd and validator.w3.org not validate Zend Forms. Tell me how you can validate Zend's html use $view->doctype('XHTML1_STRICT');, but is work only for FormText View Helper :/ example Zend output: <input type=""> I need: <input type="" /> ...

CLI include paths to run zend framework via cron

I wrote a command line utility using Zend Framework to do some nightly reporting. It uses a ton of the same functionality the accompanying site. It works great when I run it by hand, but when I run it on cron I have include path issues. Seems like it should be easily fixed with set_include_path, but maybe I'm missing something? My direc...

Zend framework multiple Validators in an array

Hello everybody I want to create a form in Zend framework. I am using the code below for a field: $this->addElement('text', 'username', array( 'label' => 'Username:', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array( 'alnum' ) )); This works. But now I also want to add ...

Howto see if form fields are identical in Zend framework

Hi there, In Zend Framework (1.10) i want to check if two input fields are identical I have the following code in my form: $this->addElement('password', 'password', array( 'label' => 'Wachtwoord:', 'required' => true ) ); $this->addElement('password', 'verifypassword', array( 'label' => 'Bevest...

Zend Framework Multiple Table Query

I am looking to execute this statement via Zend Framework. As I understand it, I can use Zend_Db_Select. Is it possible to use Zend_Db_Table? Three tables: classes, students, and class_students select classes.name, students.student_id, students.fname, students.lname from students, classes, class_students where class_students.student_id...

Zendframework / PgSQL fetchAll orderby

i have a pgsql table with fields id, identifier, name. id serial NOT NULL, identifier character varying(16), name character varying(128) I want to fetchAll values from the table orderby identifier. but identifier is having values 12, 100, 200, 50 and after $table->fetchAll(null, 'identifier'); is giving the result 100, 12, ...

new controller in oo php

Hi , I have a practical doubt , I am using OO php , and i am new to it. I am using zend framework to be clear. I am writing controllers(class) and actions(methods) with in it say PatientMapper.php which has all single mysql table related actions and Patient.php which has all setter and getter functions. I get a doubt that when should ...

Zend_Db_Select: regrouping conditions in where clause

Hi, I would like to do something like this: $select = $myTbl->select() ->from('download_log') ->joinLeft(...... etc........ ->joinLeft(...... etc........ ->joinLeft(...... etc........); //Filter all configured bots (Google, Yahoo, etc.) if(isset($this->_config->statistics->bots)){ $bots = explode(',',$this->_config->statistics->bots)...

Improve my Zend Stored Procedure calling code.

Hi, I'm wondering how i can improve my Zend code that calls a stored procedure. At the moment i'm using a MySQL DB, and the action function in my controller below works, but it seems nasty. public function callSPAction() { $param = $this->_request->getParam('param', 0); $bootstrap = $this->getInvokeArg('bootstrap'); $confi...

ZFDataGrid table width

I'm using zfdatagrid to display a table within a Zend app. How do i fix the width of the table? I can't find any setting in the grid.ini. public function displaytemptableAction() { $config = new Zend_Config_Ini(APPLICATION_PATH.'/grids/grid.ini', 'production'); $db = Zend_Registry::get("db"); $grid = Bvb_Grid::factory('Tab...

Zend Framework - Does Zend_Soap_Client supports SwA (Soap With Attachments)?

I need SwA (Soap with Attachments) support in php for a project. I can't find a reference in ZF docs about supporting SwA or not. Anybody knows if it is supported? If not supported, I have heard about WSO2 WSF/PHP which it does support SwA. My question would be... is it possible to integrate both ZF and WSF/PHP? Thanks in advance! Pab...

Zend Framework Custom Validation Class Error Message

The validation fails as it should but does not return the error message. $form->addElement('text', 'phone_number', array( 'required' => true, 'validators' => array( array('NotEmpty', true, array('messages' => 'Enter a valid Phone Number')), array('regex', false, array('pattern' => '/\([0-9]{3}\)\s[...

Images logging as 404s with Zend Framework

Hello, Due to Zend rewriting URL's to module/controller/action, its reporting that images are coming through as a 404. Here is the error: [_requestUri:protected] => /images/Movie/124/thumb/main.png [_baseUrl:protected] => [_basePath:protected] => [_pathInfo:protected] => /images/Mov...

ajax in zend frame work

Hi, I am new to Zend Frame Work. I am using $ajaxContext = $this->_helper->getHelper('AjaxContext'); for adding action contexts. I have one Index.phtml page and all other views are ajax.phtml pages. I have to do some java script methods in the ajax.phtml pages. But i didn't find a way to refer the js files in the ajax.phtml pages. I have...

Problem in implementing the Url Rewritting for a Zend Application

Hello everyone, I am doing my first Zend Applicaition and I am finally done with the coding side. But the problem which I have is Client has asked to rewrite the Url's which follows the SEO and as I don't have much knowledge of the Zend Router,I am finding myself helpless this time. Please helo me out.The current Url which I have is... ...

pass variable to every controller Using the Registry in Zend Framework

Can I use zend Registry to save variable to use in other controller? this is my code that don't work in another controller: Zend_Registry::set('id', $Id); ...

Invalid bind-variable name in Zend framework with Mysqli

Hi all, I was working on a application with Zend Framework and PDO_MYSQL Adapter. But my client server doesnt support PDO_MYSQL I changed the adapter to Mysqli and im getting Invalid bind-variable name error. How to resolve it thanks in advance. Regards Nizam ...