If you have a controller that presents a view for each table you can
call your
controllers an present them in the app/views/pages/home.thtml in this
way

<?php
echo $this->requestAction("controller/action/param1/param2",
array('return'));
?>

If your controller action does not have a view and it is just a
function that returns values don't use in the calling
the array('retrun'). You can grab the return of that function this way

<?php
$data = $this->requestAction("controller/action/param1/param2");
?>
Or you can even set that your action can present data in some
scenarios and return data in others
In the controller that you are going to call using the requestAction
add this to the action (function)
<?php
 if(isset($this->params['requested']) && !in_array('return', $this-
>params) ) {
            return $data;
}else{
       //Data Used to present in the view
       $this->set('data', $data);
}
?>

On Nov 8, 3:38 pm, BobDev <[EMAIL PROTECTED]> wrote:
> In my app/views/pages/home.thtml page, I want to access items from 3
> of my tables. I just want the title from each and to put it in an
> unordered list along the side.
>
> How do I do that? Can I just access the controller for each of those
> tables add a new method (eg. miniview()) and call that, then add a
> miniview.thtml page? That doesn't seem to work as when I new the
> table_controller, the Table value is not initialized so the query
> fails.
>
> <?php
>    include('../controllers/industries_controller.php');
>    $indus = new IndustriesController();
>    $indus->miniview();
> ?>
>
> Is there a tutorial on how to do this? I am not seeing it in the
> documentation, so I am probably missing it.
>
> Thanks,
>
> Bob
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to