You will access the component method by using $this->Compomentname-
>method() into the controller.

You can use the controller object in the startup function and use
something like $this->controller->set() in your component methods  to
pass variable to views, Thus they can be used by the helper.

For the DB, you could use a model and use 1) loadmodel()  2)  this-
>model = & new model() in your component::startup. Then you can access
all methods of model and the DB into the component (ie : $this->model-
>findAll() ... etc .. )

A good example for this (no model though) is the pagination component
and helper for cake 1.1

On Jul 17, 7:37 pm, citBolon <[EMAIL PROTECTED]> wrote:
> I'm trying to create a calendar component, i have a
> calendars_controller.php it works well but I want it to make re-usable
> for layouts. How can i do this ?
>
> how can i use the controller methods in a component ?
>
> summary: i want to convert a controller and view to a component and
> helper
> note: the calendar makes query to db.


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