zend-framework

Zend_Controller Following PEAR Naming Convention

I am developing a web-app using zend framework. I like how all the autoloading works however I don't really like the way Zend_Controller names the controllers by default. I am looking for a way to enable zend_controller to understand my controller class named Controller_User stored in {$app}/Controller/User.php . Is there anyway I can do...

How to get SSL+mod_rewrite+Zend Framework MVC working together?

So, I got ZF MVC site and want to force SSL connection on everything under my /checkout/ I tried using mod_rewrite for that, so my .htaccess would look like this: RewriteEngine on RewriteRule (\/checkout.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R] RewriteRule !\.(js|ico|gif|jpg|png|css|swf|xml|avi|flv|mov|mp3|wav)$ index.php [L] Sure...

Zend Zend_File_Transfer_Adapter_Http renaming question

I've got a question about renaming a file after it's been uploaded in Zend. I don't know where to put the Rename Filter. Here's what I've got. I've tried moving things around, but I'm lost. Currently it does upload the file to my photos folder, but it doesn't rename it. Thanks for any help! if($this->_request->isPost()) { $formData = ...

How to create foo.com/user in Zend?

Well i need to make it so any user can have a foo.com/username in my site where i user a Zend framework. The thing is that i want foo.com/login and other controllers to keep working as they do, so i already validate that no user can be named as one of the controllers im going to use. The htaccess cant be changed or the mvc configurati...

Tutorials For Database-Driven Routing in Zend Framework?

I am working on a project that needs to use a database driven MVC scheme where the route to the controllers and views are controlled through a single database table. However, I haven't been able to find any tutorials that demonstrate this with a current version of the framework (they all appear to have been written several versions ago) ...

Populating Selects from the Database using Zend_Form

What is the best way to populate a select element that is part of Zend_Form? I've used populate() to fill in various form element values but the select statements do not get populated. My solution, which works but I suspect is not ideal, is as follows: In the init() method of MyForm (which extends Zend_Form) I make a database call and...

Zend_Pdf - Text On Top of Shapes?

Is it possible to draw text over top of a drawn shape with Zend_Pdf? No matter what order I execute the draw statements, the shape is always on top of my text. ...

Zend Framework: How do I set a custom validator on a form element?

I'm writing a custom validator that checks that at least one field has a value. I want to validate that either 'namefield' or 'idfield' has a value. One of them can be empty, or both can have a value, but at least one of them must have a value. $nameField = new Zend_Form_Element_Hidden('namefield'); $nameField->setValue($this->nameField...

Zend Framework: is there a way to access the element name from within a custom validator?

I'm writing a custom validator that will validate against multiple other form element values. In my form, I call my custom validator like this: $textFieldOne = new Zend_Form_Element_Text('textFieldOne'); $textFieldOne->setAllowEmpty(false) ->addValidator('OnlyOneHasValue', false, array(array('textFieldTwo', 'textFieldThree'...

What is the best code location to define table relationship methods using Zend Framework models?

I'm creating a simple tag system that allows me to link a tag to almost everything in my application. In order to facilitate this, I created a table called "objects", referenced by my model "Object". I've got three models setup at the moment: Tag (with TagObject defined as a dependentTable) Object (with TagObject defined as a depended...

Refactoring To Remove Static Methods Code Smell

I have the current basic structure for each domain object that I need to create: class Model_Company extends LP_Model { protected static $_gatewayName = 'Model_Table_Company'; protected static $_gateway; protected static $_class; public static function init() { if(self::$_gateway == null) { self::...

Is Symfony a better choice than Zend for a web development shop (10+) because it is a full stack framework?

My team at work is considering to use a framework for developing web sites and applications. Some of the seniors are convinced we should use the Zend Framework because it is easier to pick-and-choose the features so the framework we will be light-weight. I'm afraid however that they are only looking at the technical advantages that a l...

How to use mod_rewrite with Zend Framework?

I've just deployed a new site using Zend Framework. Due to the popularity of my tutorials I'd like to redirect any request for a tutorial to the relevant page on the new site. So far this is what I've got: URL before Rewrite: http://neranjara.org/tutorials/?tid=56 URL after Rewrite: http://neranjara.org/article/id/56 The .htaccess fil...

How Can I Write Zend Framework URLs That Have Anchor Tags In The Body?

Using the standard MVC set up in Zend Framework, I want to be able to display pages that have anchors throughout. Right now I'm just adding a meaningless parameter with the '#anchor' that I want inside the .phtml file. <?= $this->url(array( 'controller'=>'my.controller', 'action'=>'my.action', 'anchor'=>'#myanchor' )); Thi...

Zend_Form - Array based elements?

Using Zend_Form, how would I create form elements like this: <input type="text" name="element[1]" value="" /> <input type="text" name="element[2]" value="" /> // etc... ...

Should I use a PHP Framework? If so, which one?

Hi, Ive been researching into PHP frameworks. I am trying to understand the utility of these frameworks. For e.g. does facebook use a framework? I guess not. Also, say I am developing a product which I want to sell users. Now suppose a use a framework like Zend, then I am unnecessarily imposing restrictions of using PHP 5 only. A lot...

Zend_Rest_Client - error on localhost

Hi everybody, I am using Zend_Rest_Client to connect Zend_Rest_Server, everything seems to be allright, but when I try to get() from the server I recieve this error: Zend_Http_Client_Adapter_Exception: Unable to Connect to tcp://localhost:80. Error #10060: A connection attempt failed because the connected party did not proper...

Zend Framework problem with URL mapping.

I'm trying to map an action to the base URL and default controller. Swear this should be straight forward or even an 'out the box' feature but how do you map actions in your default controller to the base url using the Zend Framework? I'm fairly new to the Framework so I'm hoping I'm just missing something obvious. Trying to map: doma...

Where do you put validation logic when using Zend Framework?

I'm seeking some examples of how people implement validation logic in the Zend Framework. My ideal implementation would keep the validation outside the controller and allow validating "Confirm password" fields and file uploads. ...

What is MVC, in relation to the Zend framework?

I'm learning the Zend Framework and it uses a MVC model. I still have not got my head around what MVC Model, View, Controller is. What are the three different areas for and what would the program flow look like? ...