zend-framework

How do i use a standard Query String + a Rewriter Route in Zend Framework

I have ZF app that is utilizing a legacy Javascript at for some functionality. In order for this app to work i need to pass it a standard query string. So how can i use a standard Zend Route with a query string on it? for example: domain.com/my/routing/rule?legacyparm1=value&legacyparam2=value It is not possible at this time to rewrit...

Am I reinventing the wheel? PHP/Mysql User reigstration and payment processing.

I'm about to code a php/mysql platform that does the following: Admin panel User registration Paypal payment processing Paypal subscription handling via api so that the user doesnt have to have a paypal account Does something like this already exist that I can use? If nothing exists like this, I'm going to code it fresh in the zend ...

Magento - Custom Payment Module

This is a very general question, but here goes: I'm trying to create a custom payment module in Magento. I've created a 'regular' module that hooks into the Magento event/observer model. But how do I tell Magento to treat a module as a payment module, so it shows up in the admin backend AND on the checkout page? ...

Is it OK to allow sometimes dynamic SQL without sanitization?

My partner on a PHP project objects my practice of always sanitizing integer values in dynamic SQL. We do use parameterized queries when possible. But for UPDATE and DELETE conditions Zend_Db_Adapter requires a non-parameterized SQL string. That's why I, even without thinking, always write something like: $db->delete('table_foo', 'id = ...

Master / Slave switch in the Zend Framework application layer

I am writing an application which requires the Master/Slave switch to happen inside the application layer. As it is right now, I instantiate a Zend_Db_Table object on creation of the mapper, and then setDefaultAdapter to the slave. Now inside of the base mapper classe, I have the following method: public function useWriteAdapter() { ...

Passing parameters in breadcrumbs

Hi Guys, I'm still a relative newcomer to Zend Framework, so please forgive me if this is a stupid question! I'm using the breadcrumbs view helper in my application's main layout to provide the usual breadcrumb functionality. However I really need the breadcrumbs to contain the parameters passed to the actions that user has clicked o...

Doctrine ORM JOINS

I have a few simple classes, all extending Doctrine_Record. Now I want to make a slightly more complex query with Inner Join, not just table data extracting. I am doing to use DQL, does this oblige me to manually define relation between 2 tables? Should I define this relation class or I better update schema.yml and somehow re-generate...

Zend Framework - Getting a helper from within a registered plugin

Is there any way to get access to a helper class from within a registered plugin. From within the controller, one can use: $this->_helper->getHelper($helperName); Specifically, we use the FlashMessenger helper to pass error and info messages around to different pages before we do a redirect. In one of our plugins, we log a user out an...

Zend_Paginator; is it optimized??

Hello, I am about to use Zend_Paginator class in my project. I found examples of the class on the internet. One of them is $sql = 'SELECT * FROM table_name '; $result = $db->fetchAll($sql); $page=$this->_getParam('page',1); $paginator = Zend_Paginator::factory($result); $paginator->setItemCountPerPage(10)); $paginat...

Run Zend Frameworke with Apache 2.2

Hi all, I have a project written with zend framework. I was using xampp for my webserver which uses apache 2.2. I decided to use apache 2.2 instead of xampp. I installed apache 2.2 and copied my project into htdocs folder of apache like I did with xampp. But when I enter my project URL into the browser, it doesn't show my index.php and i...

How do I go around this Zend_Form_Element_Select db error?

When i use the Zend_Form_Element_Select elements with multioptions i get this error when i pass the selected value to Zend_DB_Table to insert into the db Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'accounts_status ' in 'field list' I have extracted some code snippets that i believe will go a long way into illustra...

help with Zend_Auth_Adapter_DbTable

Hi all, I'm starting with the Zend framework and I wanted to use Zend_Auth_Adapter_DbTable to authenticate my users ... I looked at the docs, which seem quite straight forward, but I'm getting an error. Here's my code snippet : $adapter = new Zend_Auth_Adapter_DbTable($this->_dbAdapter, 'users', 'username', 'password', 'MD5(?)'); ...

Is it secure to use a controller, module or action name to set include paths?

I want to set up include paths (and other paths, like view script paths) based on the module being accessed. Is this safe? If not, how could I safely set up include paths dynamically? I'm doing something like the code below (this is from a controller plugin.) public function dispatchLoopStartup(Zend_Controller_Request_Abstract $reque...

Why is Zend Framework so popular?

I'm not a troll and my goal isn't to start a flame war; neither do I mean to disrespect the authors of the Zend Framework: there is a lot of fine work in it. But... I have a job to get done and I'm having a hard time reconciling the popularity of ZF against the reality of building apps with it. I would really like to know from others why...

Zend Framework - shared view script path ( global partials )

How is it possible to set up a shared view script path for partials to create global partials within the Zend Framework? We know that you can call partials between modules e.g - echo $this->partial('partial_title','module_name'); but we need to set up a partial folder in the root ( i.e below modules) so that it can be access...

Zend Framework can't find standard view helpers

I'm trying to use a View helper inside a view. I put echo $this->formCheckbox('foo'); in the view, but it errors out and tells me FormCheckbox.php /application/modules/user/views/helpers/FormCheckbox.php can't be found. Why isn't it loading Zend_View_Helper_FormCheckbox in /Zend/View/Helper? The manual states The default helper p...

Correct way to deal with multiple forms generated by one controller and action?

I'm using the Zend Framework and I'm about to hack up some of my controller code to do something that seems like there should be a pattern for already. Currently when I only have one form, the form's action points back to the same action and controller as the one that generated the page. The controller's action function then verifies th...

Zend Cycle within Partials

Is there an alternative to using 'Cycle' when creating zebra tables in Zend. ( My version does not have Cycle helper and don't really want to have to upgrade. Using a partial loop and need each table to put out different bg color. However the partial loop doesnt seem to act as a standard loop with no repeat ...

Need complete example of authentication / authorization / access control in Zend Framework 1.9

I have some Zend Framework apps running and it's time to add user access restrictions. I am a firm believer that you should try to avoid rolling your own security infrastructure whenever possible and so I have been trying to figure out how to use Zend_Auth and Zend_Acl to implement it, so far without success. I have searched all over th...

$this->headLink() includes duplicated script

Hi, Just like I did before, I used the following code for my new project. <?=$this->headLink()->appendStylesheet('/Layouts/admin/css/button.css');?> <?=$this->headLink()->appendStylesheet('/Layouts/admin/css/inputText.css');?> <?=$this->headLink()->appendStylesheet('/Layouts/admin/css/fancyTable.class.css');?> when I open the websit...