MVC (Re: DBIx::Class - Related Tables)

Paul Johnson paul at pjcj.net
Tue Oct 7 13:48:35 BST 2008


On Tue, Oct 07, 2008 at 01:33:02PM +0100, Raphael Mankin wrote:
> 
> On Tue, 2008-10-07 at 12:50 +0100, Andy Wardley wrote:
> > 
> >     [% # display custom panel based on user status
> >        IF user.is_admin;
> >           INCLUDE admin/controls;
> >        ELSIF user.is_logged_in;
> >           INCLUDE user/greeting;
> >        ELSE;
> >           INCLUDE user/login;
> >        END;
> >     %]

> If there were many such IF statements in my templates I would tend to
> use separate templates for the user states (or whatever) and let the
> controller route to the appropriate one.

Every conditional is a missed opportunity for a derived class.

-- 
Paul Johnson - paul at pjcj.net
http://www.pjcj.net


More information about the london.pm mailing list