Sunday, August 29, 2010

Re: Function documentation?

the index() method in your controllers wont have any parameters...or maybe it will - its up to you.

Hell you don't even have to define one if you don't want to.

When someone browsers to /controller/index, it calls the index() method for the controller, which usually contains a find call for the model associated with the controller and sets a variable which is available in the index view for the controller in question.

Take a look at the blog tutorial in the book - it'll show you exactly how this works.


On Mon, Aug 30, 2010 at 10:57 AM, geoB <truckeetrout@yahoo.com> wrote:
I have searched Google, CakePHP Google Group, API Controller
documentation (versions 1.2, 1.3), API AppController documentation
(versions 1.2, 1.3) and have found no useful information on the
parameters used by the index method.  Search terms include "index
method", "index method" & documentation, "Index method" & syntax.  I
ain't no dummy, and I don't expect to be spoon-fed.

Sure, my understanding isn't what it could be.  That's why I read the
documentation.  But reading alone does not create comprehension.
Actual use of the material to observe its effects is required as
well.  But I can't try to recreate something I cannot find
documentation on.

Perhaps a more specific reference would be useful.  I have read the
manual at least twice now, and I know I'm not ready for the exam.

g

On Aug 29, 1:18 pm, "j.blotus" <j.blo...@gmail.com> wrote:
> i think you need to start again from the beginning of the manual.
> index() is controller action. It gets records from the Model and sends
> them to the view. It sounds like you don't really understand the way
> CakePHP uses MVC. Also, the core has an extensive API  for versions
> 1.1, 1.2, and 1.3.
>
> On Aug 28, 1:08 pm, geoB <truckeetr...@yahoo.com> wrote:
>
> > I am trying to get started with CakePHP and am experiencing some
> > frustration with the documentation.  (fwiw, I am moderately well
> > experienced with PHP.)  For example, I was following the blog tutorial
> > at the CakePHP website, only trying to adapt it to the database I
> > intend to work with.  I learned that the index() function was
> > referring to an index of a table.  So I started to look for the syntax
> > of the index() function to no avail.  There does not appear to be a
> > function reference anywhere that I can find.
>
> > In general, how does one learn the syntax of a specific function?  I
> > hope it's not trial and error.  Please point me in the right direction
> > for documentation resources.
>
> > Thanks.
>
> > George

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en

No comments: