Re: Acccessing Helpers from Layout

2006-05-24 Thread AD7six
Hi Modfather, I am assuming that you have not created any other controllers and have only edited the App controller, and are testing with your home page. I think the problem might be that you are defining an array of helpers to be used in you app_controller, which is overriden by the pages contr

Re: Acccessing Helpers from Layout

2006-05-24 Thread modfather
Just tried further debugging; 1. moved custom helper out of element and straight into layout result = fatal error - as above. 2. added the custom helper to the core html helper file - result it works in the layout, ie $html->makeEdit(). 3. There must be a problem with the appcontroller file not re

Re: Acccessing Helpers from Layout

2006-05-24 Thread modfather
Just reinstalled cake added the same pages as before but still get the " Fatal error: Call to a member function on a non-object in /cake/app/views/elements/test.thtml on line 1" - very,very frustrating - i think these sort of php/framework errors are the reason i left php for ruby on rails in the

Re: Acccessing Helpers from Layout

2006-05-24 Thread modfather
AD7six, firstly thanks for your input and contributions in the wiki and forum. I am using PHP Version 4.4.2 and cake version 1.0.1.2708. I looked at your cssmenu code in the wiki as i need to generate a menu from a database - i could not get your examples to work - so i simplified the code for tes

Re: Acccessing Helpers from Layout

2006-05-24 Thread modfather
thanks for the replies, Olivier i am creating a custom helper for testing purposes, it is not extending HtmlHelper, thus i don't need to declare html in my helper array/or my linkhelper class as it is set by default(anyway). I set my"link' helper in appcontroller so it is globally available thus a

Re: Acccessing Helpers from Layout

2006-05-24 Thread AD7six
Hi Modfather, If your question was more how can to define your own helpers rather than how can I create a link, it seems to me that you were on the right track. I copied your code from this post to make absolutely certain before replying - I can't duplicate the error (not that that means much) wi

Re: Acccessing Helpers from Layout

2006-05-24 Thread AD7six
Don't know where my first reply went, hope it doesn't pop up eventually... Modfather, I glanced over your code, then put it in a clean install to be sure, and can't see anything wrong :P. If you still have the same problem: What version of cake are you running, any other code changes, and what

Re: Acccessing Helpers from Layout

2006-05-24 Thread John Zimmerman [gmail]
I am currently using menu's the way hydra12 is.  By putting them in the elements folder and calling renderElement in my layout.  So far so good.On 5/24/06, Olivier percebois-Garve <[EMAIL PROTECTED]> wrote: Modfather I think Nick is right this is your bug.(var $helpers = array('link'); sho

Re: Acccessing Helpers from Layout

2006-05-24 Thread Olivier percebois-Garve
Modfather I think Nick is right this is your bug.(var $helpers = array('link'); should be var $helpers = array('Html');) AFAIK, Your approach is fine. A helper set in appcontroller will be available in the layout files. olivvv Nick Wientge wrote: Well I'm a bit of a noob, but what is: var

Re: Acccessing Helpers from Layout

2006-05-24 Thread hydra12
I've done this a couple of different ways. When I had a static menu, I put this into my layout: renderElement('menu')?> I saved menu.thtml in my elements folder Menu Item 1 Menu Item 2 When I needed dynamic content, my menu.thtml looked like this: link($pa

Re: Acccessing Helpers from Layout

2006-05-24 Thread Nick Wientge
Well I'm a bit of a noob, but what is: var $helpers = array('link'); Shouldn't it be: var $helpers = array('Html'); On May 23, 2006, at 10:35 PM, modfather wrote: > > I am attempting to add a Global menu to the layout file (thinking this > is the appropriate place to put it). I tried the css

Acccessing Helpers from Layout

2006-05-23 Thread modfather
I am attempting to add a Global menu to the layout file (thinking this is the appropriate place to put it). I tried the css-menu tutorial available in the wiki and it failed. I then again scaled back to test the following; class AppController extends Controller { var $helpers = array('li