Yes, CakePHP explanations can be terse. However, there is a
description of how a CakePHP app gets started in section one of the
manual (see:
http://book.cakephp.org/view/10/Understanding-Model-View-Controller).

> 1. Where are the objects ??
>  I see lots of classes but no instances of them.Yes, there is '$this',
> but it doesnt count since its a reference to an actual object, which,
> as far as i could see in all the tutorials, doesnt exist yet.
>

It all starts with the Dispatcher. An instance of the Dispatcher gets
created near the end of /app/webroot/index.php. From there, the app
follows the conventions of CakePHP to know that the controller that it
needs to create an instance of is contained in the URL. That's why
URLs are in the form /app_name/controller_name/action/arguments.

The instantiation of the controller class by the Dispatcher results in
the instantiation of other classes like Helpers, Models, Components,
etc. Some are instantiated by default, other you define with member
variables like $uses and $helpers. The code that actually instantiates
these classes is in the core CakePHP libraries. You don't really need
to know the guts but the code is all there to follow if you want.

The power if CakePHP is that you don't have to write a bunch of code
to do things like instantiate classes, do input validation, render
output etc.. Instead you follow the conventions and CakePHP library
classes and methods do the trudgery.

It is important to know the general control flow of CakePHP so you
understand why functions like beforeFilter() and beforeRender() exist
and why you would use them. Check out:
http://book.cakephp.org/view/21/A-Typical-CakePHP-Request

> 2. I see of a static parent::method and variable, i see variables that
> are handled via arrays, but where are object references ??

As said in anohter post $this->Model->find IS a reference to am
instantiated class. You define this either by following the convention
and creating a Model class or by adding a model name to $uses. Again,
the CakePHP libraries just follow the conventions to instantiate the
classes you tel it to.


> 3. also havent come across a protected method in any tutorial yet.
> Why is that - just by chance ? or did i not look well enough.

That's PHP4 syntax (as in another post).
>
> So. In order to use the structure it is essential to know whats
> actually going on. 'sentences like 'cake' does this or that dont help,
> btw. escpecially since i have no clue who the hell 'cake' is :).
>

CakePHP is an instance of and MVC framework. Period. You might want to
read up on what MVC is some more.
Try:
http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

Then again -there's nothing like experience - so, go through the
motions, follow the conventions, implement a simple app or two or
three and you will learn a bunch.

I hope this helps,
Ken


--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to