Re: who is 'Cake' : some basic oop cake nonunderstanding

2009-06-23 Thread lefty

Hi Ken. It did help. my main problems were revolving around data
handling between different classes (of models  controllers).

If you created  have the  instances yourself (written the code that
does ..) you know how they can handle data to some other instance. i
just couldnt get my head around the queer syntax, and it wasnt obvious
to me that a controller can call its model method to call another
models method with data just being transferred in arrays as simple as
can be, really.
Now i understand the syntax (a tiny bit at least) and can keep
learning.

I see lots of requireAction discussions, and they might be the result
of the same, very basic, problem, on how to move data around without
having to go via the view - even though request action will do just
that, and even a complete newbie like me can see thats stupid.
so. thx again
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: who is 'Cake' : some basic oop cake nonunderstanding

2009-06-22 Thread lefty

hi ken. yes it does :) thx
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: who is 'Cake' : some basic oop cake nonunderstanding

2009-06-21 Thread kdubya

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
-~--~~~~--~~--~--~---



who is 'Cake' : some basic oop cake nonunderstanding

2009-06-20 Thread lefty

only got into baking very recently, and while there are lots of
promises how 'supersimple' everything is with cake i still havent
found the most basic fundamentals of how its actually working.

is there anybody who can answer these simple questions - they would
help me getting a long way into actually really using cake instead of
just pasting  modifying codesnippets from other sources :

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.

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

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.

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 :).

I hope that these questions are easily answered in no cookbook
style :)
The cookbook is going into details of functionality before the basic
structure is clarified. It repeats itself with cake makes this and
that easy for you, but what i a always missing, is : how, does cake do
it. Yes the codesnippets are easy, yes the conventions are great, yes
the MVC structure is cool, and yes i'm sure cake can do it. Is there a
reference maybe, or a clear and simple model of how it does these
things, so that beginners with cake dont need to try and make 'cake'
do things in ways that it wasnt designed for ?

Many thx  lefty
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: who is 'Cake' : some basic oop cake nonunderstanding

2009-06-20 Thread brian

On Sat, Jun 20, 2009 at 10:42 AM, leftylu...@yoga-innsbruck.com wrote:

 only got into baking very recently, and while there are lots of
 promises how 'supersimple' everything is with cake i still havent
 found the most basic fundamentals of how its actually working.

 is there anybody who can answer these simple questions - they would
 help me getting a long way into actually really using cake instead of
 just pasting  modifying codesnippets from other sources :

 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.

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

There are object refs all over the place! Start with dispatcher.php
and follow from there.

 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.

Because CakePHP supports PHP4.x the public/private/protected keywords
are not used. A protected method or variable will be prefixed by a
single underscore ('_') and a private one with two ('__').

 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 a framework. If someone says that it does something it
means, this is how it works.

I agree that Cake is a bit difficult to follow, especially when first
diving into it. I'm sure there is documentation out there somewhere
that runs through a complete and *detailed* example of a request but
I've never seen it. Perhaps somebody else can post a link.

 I hope that these questions are easily answered in no cookbook
 style :)
 The cookbook is going into details of functionality before the basic
 structure is clarified. It repeats itself with cake makes this and
 that easy for you, but what i a always missing, is : how, does cake do
 it. Yes the codesnippets are easy, yes the conventions are great, yes
 the MVC structure is cool, and yes i'm sure cake can do it. Is there a
 reference maybe, or a clear and simple model of how it does these
 things, so that beginners with cake dont need to try and make 'cake'
 do things in ways that it wasnt designed for ?

 Many thx  lefty
 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: who is 'Cake' : some basic oop cake nonunderstanding

2009-06-20 Thread Miles J

Objects are used everywhere. What do you think your doing in a
controller when you access models or components?

$this-Component-method();

Take a look at Auth, it references the Controller object as well as
modifies it.

On Jun 20, 8:34 am, brian bally.z...@gmail.com wrote:
 On Sat, Jun 20, 2009 at 10:42 AM, leftylu...@yoga-innsbruck.com wrote:

  only got into baking very recently, and while there are lots of
  promises how 'supersimple' everything is with cake i still havent
  found the most basic fundamentals of how its actually working.

  is there anybody who can answer these simple questions - they would
  help me getting a long way into actually really using cake instead of
  just pasting  modifying codesnippets from other sources :

  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.

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

 There are object refs all over the place! Start with dispatcher.php
 and follow from there.

  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.

 Because CakePHP supports PHP4.x the public/private/protected keywords
 are not used. A protected method or variable will be prefixed by a
 single underscore ('_') and a private one with two ('__').

  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 a framework. If someone says that it does something it
 means, this is how it works.

 I agree that Cake is a bit difficult to follow, especially when first
 diving into it. I'm sure there is documentation out there somewhere
 that runs through a complete and *detailed* example of a request but
 I've never seen it. Perhaps somebody else can post a link.

  I hope that these questions are easily answered in no cookbook
  style :)
  The cookbook is going into details of functionality before the basic
  structure is clarified. It repeats itself with cake makes this and
  that easy for you, but what i a always missing, is : how, does cake do
  it. Yes the codesnippets are easy, yes the conventions are great, yes
  the MVC structure is cool, and yes i'm sure cake can do it. Is there a
  reference maybe, or a clear and simple model of how it does these
  things, so that beginners with cake dont need to try and make 'cake'
  do things in ways that it wasnt designed for ?

  Many thx  lefty
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---