zend-framework

Zend Form Radio Default Checked

I have the next radio button group: $enabled = $this->createElement('radio', 'enabled') ->setLabel('Enabled') ->setMultiOptions(array('1'=>'yes', '0'=>'no')) ->setValue($rank_values['enabled']) ->setAttrib('id', 'enabled') ->setAttrib('class', $action . '_en...

When a Web framework isn't convenient to use ?

When a Web framework ( like django, ruby on rails, zend, etc ) isn't convenient to use ? And so... When a Web programming language ( like PHP, Asp, Python, etc ) is better than a Web Framework ? ...

Creating a RESTful application in Zend

I have a controller that extends Zend_Controller_Action. It contains some actions that I need to give people access to via a RESTful MVC web service. I've seen some articles that have told me to extend using a different class (Zend_Rest_Controller) but this seems to mean I need to override certain abstract methods and really I no use fo...

issue in zend framwork controller

Hello I am a new bie to zend framework I am getting an error while loading my index controller as Fatal error: Class 'Places' not found in C:\xampp\htdocs\zend\book\application\controllers\IndexController.php on line 36 my bootstrapper code is <?php class Bootstrap { public function __construct($configSection) { $r...

Problem in Getting values from an array in PHP

iam using the Zend framework and assign the array from the controller to view. The array is coming from execution of stored procedure result $results = callProcedure('testprocedure', $in)//$in is an array of input values $view->results =$results['record']; In The $results['record'] array iam having two values such as 'NO' and 'nam...

Zend framework dynamic breadcrumbs lable

Hey, I have got the Zend navigation in in navigation.xml which is like this: <nav> <home> <label>Home</label> <controller>index</controller> <resource>index</resource> <action>index</action> <pages> <Reports> <label>Reports</label> <controller>Re...

How to switch on Zend Framework with existing php project.

I have an application which I want to convert to Zend Application. I have to continue by doing next tasks in zend but previous pages should work as they are working. Existing php project is a simple php project with very simple directory structure and all files are in one folder. I created a zend project(test) separately and put all ex...

problems using Zend_Db when running php as cli script

Hi, I am trying to add some administration scripts to a Zend Framework project, that will end up being run nightly via cron. However I've hit my first problem with the script when trying to use Zend_Db. I am currently doing a very simple SQL call to get some results and just display them using var_dump() however I get the following e...

pcntl_fork and the MySQL connection is gone

I have a foreach loop that forks within it. After the process forks, it accesses the database. I get an error: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away The thing is, I'm connecting to the database after I've forked. My question: Why would this be happening? If this happens, am I actually accessing the database...

How do i assign a custom helper to each view differently in zend framework

i have a custom helper written which returns the html form as string which extends the Zend_view-hepler_Abstract Now i have 3 helpers .How do i assign each helper to a different view . It is something like this in the controller class abc extends Zend_controller_front{ public action page1Action (){ // I want to use a different Help...

Zend Redirecting [solved]

For some reason my zend application is redirecting when it's not supposed to. The index view just shows the form. The next view shows some information from a database based on the information supplied by the form. The user then clicks on a confirm button which sends them to anotherAction which constructs and sends an email. I've got a t...

How to load plugins with modules

I have this plugin in the plugins directory within the admin module directory. So, it is in application/modules/admin/plugins/LayoutPlugin.php: <?php class LayoutPlugin extends Zend_Controller_Plugin_Abstract { public function preDispatch(Zend_Controller_Request_Abstract $request) { $layout = Zend_Layout::getMvcInstance(); ...

How to add a page inside some levels using Zend_Navigation?

I'm using a XML (click here to see) with Zend_Navigation to render this: which Menu Principal is the first level, then Home and Quem Somos, then the dropdown is the third and last level. I want this last list to be dynamic (querying from the database). I found out that I can use the method addPages($array) in order to dynamically rend...

Zend Framework: Working with Form elements in array notation

I would like to be able to add a hidden form field using array notation to my form. I can do this with HTML like this: <input type="hidden" name="contacts[]" value="123" /> <input type="hidden" name="contacts[]" value="456" /> When the form gets submitted, the $_POST array will contain the hidden element values grouped as an array: a...

Including other libraries in Zend Framework applications

I have a ZF application using the standard structure: application/ <etc> library/ Zend/ public/ tests/ I also have a separate library using the following structure: library/ <classes> tests/ library/ Both use git for source control. I'd like to include the library in the application, but I'm struggling to find a nice...

how to get dynamic URL like mydomain.com/username using zend framework

Hello guys I am developing an application using zend framework. In the application I have to provide a URL for each user like mydomain.com/[username] then public will be able to view his profile. [username] is the username of the particular user But how can I achieve this ? I think in ZF mydomain.com/username tries to get the controll...

zend headtitle using zend_navigation

I am using zend_navigation for creating menu. Which works fine. Now i m looking if i can take current page and set it as page title using headTitle. Is there is any way to do that? or how can i use config files (.ini) for creating Pagetitle and meta data ? ...

Uncaught Exception 'PDOException' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server

Hi, I am using Zend Framework and my application works on localhost but produces the can't connect to MySQL server error when I'm trying to connect to the database I've uploaded on a live server. I've tried handling exceptions and Zend_Exception catches it("perhaps factory() failed to load the specified Adapter class"). I've emailed the ...

phing and phpunit + bootstrap

How to run PHPUnit test suite with bootstrap file with phing? My app structure: application/ library/ tests/ application/ library/ bootstrap.php phpunit.xml build.xml phpunit.xml: <phpunit bootstrap="./bootstrap.php" colors="true"> <testsuite name="Application Test Suite"> <directory>./</directory> </testsuit...

Static method, Zend_View error

I have a static method 'findAll' on a model which basically gets all rows with certain criteria. This method works fine and I can call it using: $m::findAll(); Where $m is the model name as a variable. I can output this and it returns correct results. However, when assigning this to a variable in the Zend_View object, as: $this->view...