Sonic Baker wrote:

> In my quest to follow the DRY principle I've been looking into 
> refactoring my views. If you use Bake to generate default views you'll 
> have 'add' and 'edit' views. These both share the same form inputs and 
> if you start playing around with error messages you'll have to do it on 
> both forms.
> Would this warrant the use of Elements?
> Or would an element be overkill for this?
> 
> What are others doing?

I don't use the Baked views for anything other than very small projects 
because I find they quickly become very cumbersome and quite 
unmanageable when you've got a large application to build.

To be brief, what I've done is create a meta-framework that works 
hand-in-hand with Cake (using Cake itself and a small number of external 
scripts and processes) that is able to generate all of my views for me 
using a series of reusable elements and helpers.

This meta-framework knows when to expose information on a given screen 
using what I call "applets" (nothing to do with Java).  Applets are a 
collection of fields in a certain state and having certain properties 
(or rather a collection of fields spanning multiple models associated 
with an instance of an applet that is assigned to a particular view).

I've found very few framework environments in PHP and Perl that provide 
this sort of functionality in an effective and manageable way so I've 
typically had to rebuild it myself when moving to a new framework such 
as Cake.

The neat thing about this is that I can effectively build several 
relatively complex screens with various applets that are linked together 
(such as a list & selection detail combination) inside of a half-hour, 
leaving me plenty of time to be concerned with more important things 
like business logic, tests and whatnot.


Cheers,

Matt
-- 
BASIC: A programming language.  Related to certain social diseases
in that those who have it will not admit it in polite company.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to