Monday, 5 May 2008
In the previous entry, we created a new Administration Module to hold blog management functionality, added a Module specific layout for it, and discussed the upcoming need to ensure this is only accessible by authorised Authors. In this entry I’ll unravel some of Zend_Form’s mysteries in adding a login form, before using Zend_Auth to implement authentication for authors.
Previously: Part 5: Creating Models with Zend_Db and adding an Administration Module
Authentication in the Zend Framework is the domain of the Zend_Auth component, and it is really easy to use. Zend_Auth is really an abstract API to a number of components working in concert, and without the usual micromanagement of database interaction, sessions, cookies and user data persistence, it makes my life a lot simpler. Of course authentication demands a login form, and so I’ll first visit using Zend_Form. Zend_Form is an interesting component because it’s one of the worst to get started with. The manual, as it does for all components, does not impose a best practice to setting up forms. Mix that with the number of form organisations possible (class based, config based, view template based) and it can be very confusing.Step 1: Adding a Login Action and ViewBefore we actually perform authentication, we need a login form. I’ve decided to attach all Author account actions to an Author Controller. Add a new file called AuthorController.php in /application/controllers/ containing the following:
Nothing major here, except for a mysterious reference to a view variable, $loginForm!Step 2: Creating a Login form with Zend_FormZend_Form is one of the most recent additions to the Zend Framework with the release of 1.5. It’s not surprising it took so long since a decent Form library is not a trivial component to get through development.
The object oriented approach to developing forms takes a bit of getting used to but it works wonders for simple forms that don’t need a heavy design hand. I suppose from my own perspective it was design over functionality that first struck me as problematic when I started using Zend_Form but I think I’m over that learning curve, so let’s see how this look at a simple two field login form goes
(more…)
Popularity: unranked [?]
Tags: Example, Framework, Application, Tutorial, Introduction, Zend_Form, Authentication, Zend_Auth, Pdraic, Brady
Saturday, 3 May 2008
The Bakery (the CakePHP programmer’s resource) has a few new articles, tutorials and components that have been posted lately. Here’s the list:
Preview and alter the SQL generated from Model::find()
After 3 years, looking back and moving ahead
Encrypted Cookie Component
Open Flash Chart Helper: draw charts the Cake way
Maintaining an Application-independant Code Library
Rolling you own Gallery2 component
DarkAuth v1.3 - an alternative Auth
Easy AJAX Pagination Using JQuery
Be sure to check out the rest of The Bakery for more great CakePHP-related content.
Popularity: unranked [?]
Tags: Bakery, Latest, Articles, Tutorials, Components
Saturday, 3 May 2008
Michael Kimsal has release the last podcast of his MySQL Conference series of interviews with other attendees. In this episode, he interviews Brian Moon of the Phorum project (employed at DealNews.com).
Brian was kind enough to review both of his presentations which go in to great detail about the scaling issues he’s faced both with DealNews.com and the Phorum forum software project (which recently turned 10 years old!) […] Thanks to Brian for going over things in such detail!
You can download this latest episode from the WebDevRadio site as well as check out Brian’s slides from his MySQL conference presentation.
(more…)
Popularity: unranked [?]
Tags: WebDevRadio, Episode, Brian, MySQL, Conference
Wednesday, 30 Apr 2008
Today I’m going to talk to Derick Rethans. Derick Rethans provides solutions for Internet related problems. He has contributed in a number of ways to PHP, including the mcrypt, Date and input-filter extensions, bug fixes, additions and leading the QA team. He now works as project leader for the eZ components project for eZ systems A.S. In his spare time he likes to work on Xdebug, watch movies, travel and practise photography.
Popularity: unranked [?]
Tags: Abstract, Podcast, Episode, Interview, Derick, Rethans, planetphp
Tuesday, 29 Apr 2008
The prolific Michael McLauglin just sent me a copy of his other new book “Oracle Database AJAX & PHP Web Application Development”, co-written with Lee Barney.
Last year I’d really wanted to extend our Oracle OpenWorld conference tutorial on PHP into this area. That didn’t happen because the 2007 tutorial slots turned out to be very short. This year I’m pushing for a longer tutorial again, so the book is a welcome reminder about the topic.
I’m looking forward to reading it.
Popularity: unranked [?]
Tags: Oracle, Press, Christopher, Jones
Monday, 28 Apr 2008
Marco Tabini has posted his list of what he considers five features of PHP5 that you “can’t afford to ignore” when doing your development work:
Despite the fact that you may not have a choice in the matter, upgrading comes with a number of bonus new features that can help you write better code and gain access to new functionality that required a fair amount of hacking in previous version. Here’s a quick list of 5 personal favourites.
The feature to make his list are SimpleXML, JSON/SOAP, PDO, the Standard PHP Library and SQLite. Each has their own bonus feature(s) included too for a little extra incentive to check them out.
(more…)
Popularity: unranked [?]
Tags: Marco, Tabini's, features, can't, afford, ignore
Monday, 28 Apr 2008
The Developer Tutorials blog has a recent post that talks about manipulating objects in PHP with the help of the iterators that the Standard PHP Library has to offer.
It’s a generally accepted fact that more readable code is more maintainable and easier for other developers to pick up. […] Today I’m going to take a look at object iteration, most commonly found in the Standard PHP Library, and explore using the Iterator interface to simplify looping.
The main part of the tutorial shows how to implement the Iterator interface of the SPL to create your own custom methods, theirs being a Database version with methodsfor rewinding, reading and getting the current record you’re working with.
(more…)
Popularity: unranked [?]
Tags: eveloper, Tutorials, Iterating, objects, readable
Saturday, 26 Apr 2008
Recently, the Springloops version control system made its debut on the web and was greeted with both skepticism and interest. One developer, Hasin Hayder decided to look at it from a different angle and worked to see how easy it would be to reproduce a similar service.
Springloops is a nice code management service recently came into focus. It helps you to manage the code base of your application, monitor the commit and deploy the final version easily to another server. So if you are wondering how to build such a system and how it actually works, this article is for you.
(more…)
Popularity: unranked [?]
Tags: Hasin, Hayder's, springloops
|