<?php $modelName = 'YourModelNameHere'; if ($Model =& ClassRegistry::getObject($modelName)) { debug($Model->schema()); } else { echo "Model <code>$modelName</code> not loaded"; } ?>
On Feb 18, 3:43 pm, "Siebren Bakker" <[EMAIL PROTECTED]> wrote: > @the_woodsman, yes, the form helper does have knowledge of the schema of the > database. If you have SQL debugging on, you will notice that pages with > form-helpers on them will perform a "DESCRIBE table_name", so that it is > able to match the $form->input() with the correct type of input for the > appropriate database field. Not sure how this will help you in getting the > database schema available in the views though. > > On Feb 17, 2008 4:07 PM, the_woodsman <[EMAIL PROTECTED]> wrote: > > > > > > > I don't really know, but I do think the form helper has some knowledge > > of the database schema; why not take a look in there for an example? > > >http://api.cakephp.org/1.2/form_8php-source.html#l00491 > > > On Feb 17, 10:35 am, Tomka <[EMAIL PROTECTED]> wrote: > > > Hello. > > > > I tried and searched for an hour, but I could not find a solution: > > > > How can I access the schema of a model in a view? > > > > Tomka. > > -- > In the name of Life, Liberty, and the pursuit of my sanity. > Siebren Bakker(Aevum Decessus) > -----BEGIN GEEK CODE BLOCK----- > Version: 3.12 > GCS d- s+: a20 C++++ UL++ P L++ > !E W++ N(-) o? K? w(+) O? M-- V? > PS+ PE Y- PGP- t+ 5? X- R tv-- > b++ Di D+ G+ e h! r y- > ------END GEEK CODE BLOCK------ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---