I've added this code to my app_controller and changed it to reflect my
data model (my table is called controls instead of categories).
Now I get the following errors on every page:
Notice: Undefined property: AppController::$Control in /Library/
WebServer/Documents/serials/app/app_controller.php
Hi i am trying to make a menu, it renders fine in the default.thtml
but how can i get data in the menu.thtml. Does it get's it's data from
a component or a controller ? as i see that for example pagination is
stored under app/pagination and not under controller or models ?
I can't find anything
Yes that i found but where should it get the array from ?
On Feb 19, 4:17 pm, Jon Bennett [EMAIL PROTECTED] wrote:
Hi i am trying to make a menu, it renders fine in the default.thtml
but how can i get data in the menu.thtml. Does it get's it's data from
a component or a controller ? as i
Yes that i found but where should it get the array from ?
ahh, ok. In your controller, you would do this:
$menu_data = array('lorem','ipsum','etc');
$this-set ('menu_data', $menu_data);
then in your view you would do:
echo $this-renderElement ('menu', array('data'=$menu_data));
then, in
Ok so i render it now in default.thtml so it is everywhere, does that
mean that i must do the data handeling in app/app_controller.php
On Feb 19, 5:11 pm, Jon Bennett [EMAIL PROTECTED] wrote:
Yes that i found but where should it get the array from ?
ahh, ok. In your controller, you would do
Ok so i render it now in default.thtml so it is everywhere, does that
mean that i must do the data handeling in app/app_controller.php
yes, or in each controller if you want it to change. You could set a a
default value for the array in the app_controller, which you can then
override in your
Ah i see, but normally you would load the function of the controller
through the url blog/post where index would be the function. But how
can you load this function without having it in the url?
I could think that maybe i can put it in the constructor of
appcontroller but this would not be really
Ah i see, but normally you would load the function of the controller
through the url blog/post where index would be the function. But how
can you load this function without having it in the url?
I could think that maybe i can put it in the constructor of
appcontroller but this would not be
Well what i want accomplish is pretty easy, I have a table
categories.. and i want to create links from the table categories in a
menu. And this menu has to be on every page no matter what the url is.
On Feb 19, 8:31 pm, Jon Bennett [EMAIL PROTECTED] wrote:
Ah i see, but normally you would
Well what i want accomplish is pretty easy, I have a table
categories.. and i want to create links from the table categories in a
menu. And this menu has to be on every page no matter what the url is.
hmm, easiest thing would be to do this in the beforeFilter of your
app_controller.
class
10 matches
Mail list logo