Hi All
I am digging in cake 1.2 and discover great functionalities such as
the caching for the elements. I was wondering if the following changes
make sense.
I have a model fieldattribut that belong to fielddef.
Fielddef represent a field in my application, such as "car brand" for
example. It's very simple, it's contains :
id
name
maxlen
Example, id = 2, name = Car brand
The Fileattribut model contains all the valid "code value" for a given
field :
id
fielddef_id
attribut
name
To come back to the car "field" some field attributs can be :
id :1, fielddef_id: 2, attribut : VW name : Volsvagen
id: 2 fielddef_id: 2, attribut: H name : Honda
etc..
This allow me to give control (admin route) for a user to add some
"code values" to some fields definition. Note that the fields
attributs will be use by other model such as "Vehicle" that contains
the code for the brand.
In cake 1.1 I use elements in forms to render a "selectTag" for the
fields "attributs". I had to make a special code to avoid the
requestAction every time in the element.
Now with 1.2 and the caching, I want to get rid of this code and
ideally I would cache the possible attributs for a given fielddef_id.
Ideally I would like to cache an element according to the fielddef_id.
I had a look at the view.php in the core and the caching is done using
the element name.
Ideally if another parameters ie : cacheExt could be added and
integrated into the cahefile name, that would be perfect. I could then
cache the element using the fielddef_id and of course in my "admin"
management of the fieldattribut, I would delete the cache file when
modified, deleted.
in a view that could give : $this->renderElement('tagattribut'
array('data' => 2, 'cache' => '+30 day", $caheExt => 2). That will
cache the file ''element_' . $plugin .'_' . convertSlash($name).'_'.
$cacheExt (if $cacheExt is set of course)..
Looking at the view.php code (element method), it does not require lot
of changes. This could also be used in multiple language application
(ie : the current language could be used as $caheExt).
Is this idea completely stupid or maybe I tackle this in the wrong
angle ?
Thanks
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---