Friday, April 8, 2011

Re: naming Model

Imagine your native language, say, Japanese, doesn't inflect for
pluralization. Now imagine you're using a framework that does. While
I'm not going to suggest that 5 months is now reasonable for getting
some basic functionality going, it seems totally reasonable to me that
5 months later you still don't understand intuitively why some things
are singular and some things are plural.

On Apr 9, 8:18 am, euromark <dereurom...@googlemail.com> wrote:
> seriously? you have been using cake for 5 months now?
> you did not yet get the console working or understood the most basic
> principles as outlined in the cookbook?
> ähm.. i am speechless
>
> On 9 Apr., 02:08, cricket <zijn.digi...@gmail.com> wrote:
>
> > On Fri, Apr 8, 2011 at 7:55 PM, cake-learner <sh.koiz...@gmail.com> wrote:
> > > I have following Controller and Model set up manually since the baker
> > > is not so easy to use.
> > > But somehow I can't get to work. First of all, about the class name, I
> > > am not sure why they want to use singular for model and plural for
> > > controller
>
> > A model represents a single entity. So, singular. A controller handles
> > collections of entities (in a sense). So, plural.
>
> > > and small letters for routes.php. It's been nightmare with cakephp
> > > project for last 5 months.
>
> > > class TemplatesController extends AppController {
> > >  $name = "Templates";
> > >  function index(){
> > >  }
> > > }
>
> > If you're using PHP 5.x you can leave out $name here.
>
> > > class Template extends exends Model{
> > >  $name = "Template";
> > > }
>
> > Typo? And it's AppModel.
>
> > class Template extends AppModel
>
> > Ditto about $name here.
>
> > > Router::connect('/template_page/:id',array('controller'=>templates',
> > > 'action' => 'index',  'client'=>$domains[0]) );
>
> > I don't understand what $domains is so no comment.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate