News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lee Blue's Blog:
How To Implement A Ruby on Rails style before_filter With The PHP Zend Framework
February 04, 2008 @ 14:36:00

Lee Blue has posted something looking to bridge yet another gap between Ruby on Rails and PHP - a method for adding before_filter functionality to PHP.

I often use this when implementing a simple login screen for a password protected section of my application. In a Zend Framework application you can implement a preDispatch() function in a Zend_Controller_Action which will run before an action is dispatched. This lets you setup your filter to check to see if the visitor is logged in or not. If the visitor is not logged in, you can redirect them to the login screen of your application.

He includes example code to show its usefulness - checking to see two things: is a user is logged in and to see if they're allowed to use a certain resource.

0 comments voice your opinion now!
rubyonrails zendframework beforefilter user access permission


blog comments powered by Disqus

Similar Posts

Stefan Mischook's Blog: PEAR vs. Zend Framework

InfoWorld: Zend readies PHP applications framework

Brandon Savage's Blog: Controlling Access: Zend_Navigation and Zend_Acl

Padraic Brady's Blog: Zend Framework Blog Tutorial - Part 7: Authorisation with Zend_Acl & Styling

Hasin Hayder's Blog: RSA Encrypting and Decrypting data with Zend_Crypt_Rsa Library


Community Events





Don't see your event here?
Let us know!


threedevsandamaybe unittest laravel opinion language configure version series composer api podcast framework symfony conference interview list community voicesoftheelephpant release introduction

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework