zend-framework

Extending [Namespace]_Model_[Table] classes. is it safe?

Hello ladies and gentlemen! I'm new to php and zend framework and fill very uncertain about following: For example, I have two tables: table1: box(id, height, width, length, weight) table2: labels(id, boxid, text, position) labels.boxid -> box.id (labels.boxid is a foreign_key for primary_key box.id) I've generated two separate sta...

Zend DB Table Where Clause

I'm trying to use an array to set the where parameters for a Zend DB Table. I am trying to follow an example in the documentation: $select = $table->select()->where(array('bug_status = ?' => 'NEW')); I have a class that inherits Zend_Db_Table and am trying to select like the example: $select = $this->select()->where(array('FirstName...

How can I protect users from cross-site request forgeries using the Zend Framework?

My program uses Zend Framework, and I wanted to protect users from CSRF using Zend_Form_Element_Hash. But It doesn't seem to work. For example, my code for Logout Form is $exithash = new Zend_Form_Element_Hash('hihacker', array('salt' => 'exitsalt')); $this->addElement($exithash); In my Auth plugin for Controller I do $e...

PHP, Zend Framework quickstart tutorial: How does this work?

Here is a link to the tutorial that I am referring to. This seems strange to me...in the view script we have this code: <?php echo $this->escape($entry->email) ?> This displays the email address that has been set in the Guestbook model. But the property on the model is $_email and it is protected. We're not calling $entry->getEmail()...

How to use Zend_Form_Element_Hash?

Then I'm trying to use Zend_Form_Element_Hash it regenerates a hash every request. In my code: // form $this->addElement('hash', 'hihacker', array('salt' => 'thesal')); Then I dumping $_SESSION I see a new value each page reload. Then I send a form it reports an error "The token '28a5e0e2a50a3d4afaa654468fd29420' does not match th...

PHP Session Variable shortcuts?

So I'm doing some maintenance on a PHP site that is using $_SESSION variables. I started seeing some very very weird behavior and after hours of debugging I just figured this out. As an example, lets say I have a session variable setup like this: $_SESSION['user']['id'] = 123; $_SESSION['user']['firstname'] = 'John'; $_SESSION['user']['...

How do I include header and footer with layout in Zend Framework?

Hi, I would like to let Zend_Layout include header.phtml and footer.phtml with [layouy name].phtml. How do I do that? I tried to read codes in Zend_Layout, Zend_Layout_Controller_Plugin_Layout. I still can't figure out it.. ...

Zend Dojo comboBox not finding dojo.data

I am trying to get a dojo comboBox working in Zend, with the following code: $url = '/db/autocomplete/table/suburbs'; $element = new Zend_Dojo_Form_Element_ComboBox('suburb1'); $element->setStoreId('suburbsStore'); $element->setStoreType('dojo.data.ItemFileReadStore'); $element->setStoreParams(array('url' => $url)); $element->setDijitPa...

How to verify password field in zend form?

In my form, I'm trying to verify that the user fills in the same value both times (to make sure they didn't make a mistake). I think that's what Zend_Validate_Identical is for, but I'm not quite sure how to use it. Here's what I've got so far: $this->addElement('password', 'password', array( 'label' => 'Password:', 'required' ...

Zend_Auth and profile edit

After logging user in I make some operations on his account. After that I want to update his data held bu Zend_Auth. How can I update all data at once, and not one by one which I know how to do it? ...

Is it possible to learn Zend framework without learning PHP first?

Hi, this is maybe a silly question but I am really wondering if it is possible to use a MVC framework such as Zend without learning the language first? Thank you for your help! ...

Session Management (Zend Framework specific)

I'm trying to get the rememberMe() function to remember users and retain sessions for months at a time. I've read that if you pass a value through rememberMe() it will not work if the session has already been started. From the session_set_cookie_params() documentation in the PHP manual, "you need to call session_set_cookie_params() for...

Zend_Acl not working as advertised.

I have a large implementation of Zend_Acl and the deny function is not working as expected. It is not inheriting properly and I have unresolved conflicts with groups. Before I get knee deep in code. Are there any well know issues with Zend_Acl or advanced tips anyone wants to share. I'm having to explicitly deny access to all children ...

How to send an email using Zend_Mail, sendmail, and localhost?

I'm developing a zend framework application that includes a simple email function. The development version is running on my computer, which is running Ubuntu. The production version is going to run on a production server. When trying to send a test email to myself, I get an exception with the message: "Unable to send mail". I don't know...

Best practices: how to implement an invitation system in Zend Framework?

I've built out most of the functionality, now I'm getting stuck... I am creating a private, web application that has an invite only registration system. An admin user sends an email invitation to a user, the user clicks the link, and takes them to a page where they can create an account that has been linked to their email address. When...

Go for Zend framework or Django for a modular web application?

I am using both Zend framework and Django, and they both have they strengths and weakness, but they are both good framworks in their own way. I do want to create a highly modular web application, like this example: modules: Admin cms articles sections ... ... ... I also want all modules to be self contained with all confid...

Zend Form, table decorators

Hello, I am having an incredibly difficult time to decorate a Zend form the way I need to. This is the HTML structure I am in need of: <table> <thead><tr><th>one</th><th>two</th><th>three</th><th>four</th></thead> <tbody> <tr> <td><input type='checkbox' id='something'/></td> <td><img src='src'/></td> <td><input type='text' id='some...

Storing Sessions in DB Table Not Working (using Zend_Session_SaveHandler_DbTable)

This is my table: CREATE TABLE `Sessions` ( `id` varchar(32) NOT NULL, `modified` int(11) default NULL, `lifetime` int(11) default NULL, `data` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB This is in my bootstrap: $sessionConfig = array( 'name' => 'Sessions', //table name as per Zend_Db_Table 'primary' => 'id', ...

How to get OpenID user Profile info?

After logging into SO, my nickname shows up at the top. When I set up openid on my site, I do not get any profile information. I tried implementing OpenID using openid-selector and Zend Framework The response parameters I get: openid.assoc_handle B2Jgsdf7jkDsdfUwWBGMHUshLmavymH... openid.claimed_id https://me.yahoo.com/MyYahooId#50...

How to calculate time passed with PHP or Zend_Date?

I'm trying to create a view helper that will display the number of minutes, hours, or days that have passed since...right now. I'm not really sure how to do it. It looks like the date comparison is working, but I don't know how to get the number. Here's what I have so far: <?php class Zend_View_Helper_RecentDate { public function r...