a quick and dirty solution, add this 3 lines to the bake task in the model
to push the fields (line 746):
$data['useDbConfig'] = $name-useDbConfig;
$data['name'] = $name = $name-name;
} else {
$data['name'] = $name;
}
*
sry, I didn't read that model part
looking at bake() in the ModelTask you can see which are available:
if (is_object($name)) {
if ($data == false) {
$data = array();
$data['associations'] = $this-doAssociations($name);
$data['validate'] = $this-doValidation($name);
}
$data['primaryKey'] =
I'm trying to iterate over model fields within a custom Bake template - I
can't seem to figure out what variables might be available that would allow
me to iterate over the fields within the model.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out
you can always output data on the console for development:
debug($schema[$field]); die();
etc (or you can log them into a file like `file_put_contents($tmpfile,
print_r($schema, true));`)
this allows you to see what those variables contain.
be creative!
anyway, iterating over those fields
Mark,
Thanks for the reply - but are these variables accessible in the Model
template. I can see them in the view template, but having problems
accessing field names in the model template.
On Tuesday, March 13, 2012 2:02:59 AM UTC-7, gavrielh wrote:
I'm trying to iterate over model fields