in some instances I employ the uses attribute of a controller to
access other models so i don't have to use  the requestAction method.
for example, on my dashboard of the admin area I list a few totals:

e.g.

total users: 100
total users in last month: 35
total images on system: 32
total space on system: 1056 Kb

to do this i've given my admin controller access to my user and image model

var uses = array(
    'User',
    'Image'
);

Then within my dashboard method of my AdminController I can simply call

$this->set('user_count', $this->User->findCount());
$this->set('user_month_count', $this->User->findCount($someConditions));
etc

Then within my dashboard view (or elements therein) I can manipulate
that data any way I choose. You could employ this method to grab a
list of users and display them on your dashboard, or home page, or
wherever you wanted.

I think this method is acceptable in the MVC method. Could someone confirm?

On 08/09/06, Olivier Percebois-Garve <[EMAIL PROTECTED]> wrote:
>
>  Well,
>
>  U can also make use of requestAction in the layout, in components and I
> guess in elements too.
>
>  In my abroad experiences, sometimes, I found myself very happy when I could
> hide my French origin...
>
>
>  Brian French wrote:
>  Thanks for your help!
>  In response to my own first question, i am assuming that i am correct as i
> would have to call the requestAction for each block for each page unless
> they occure everywhere in which case i could use beforeRender()
>
>  Yes I'm American and no, it's not hard to live with :-p
>  The average American isn't as prejudice as people may believe :-p
>
>  Olivier Percebois-Garve wrote:
>  Hi
> I think requestAction is made for that.
> To avoid a method to be accessed, just use "_" as prefix e.g :
> function _blabla(){
>  //blabla
> }
>
>
> Are u american ? Isn't your lastname difficult to live with there?
>
>
> Brian French wrote:
>
>
>  Im still in the process of wrapping my head around the MVC. I understand
> the roles of each of the elements. What i am coming across that i cant
> seem to figure out is how to have multiple elements work on 1 page.
>
> Example: Myspace (i know, but good example of what im talking about).
>
> On the homepage you have multiple elements: Music box, Specials box,
> Cool new people, and videos.
>
> In my understanding of MVC, each one of them would be a different
> controller, prob calling the same method name like GetBlock or
> something. ($specials->GetBlock();, etc. ). So, the cakephp url would be
> 'Specials/GetBlock'. I have ran across the method 'requestAction' which
> can call the multiple controllers, by the cakephp url in the page
> controller. Then assign it to a variable to be used in the view.
>
> Questions:
> 1. would i basically have to create a seperate method for each of the
> pages i would have?
> 2. would the above way of using requestAction be the right way of
> accomplishing this or is there a better way to do this?
> 3. in doing it this way, what is preventing someone from access the url
> 'http://www.blah.com/Specials/GetBlock'?
>
> I hope i have explained this well enough.
>
> Brian
>
>
>
>
>
>
>
>
>
>
>
>
>  >
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to