Okay, allow me to clarify a few things: first of all, components are
*never*, under any circumstances, loaded before a the controller,
that's just not how it works.  Second of all, ConnectionManager is a
statically-accessible class, not a component, so adding it to your
$components array will do nothing for you.  Third of all,
AppController::beforeFilter( ) happens *after* your controller is
loaded.  In fact, if you have beforeFilter( ) redefined in your
controller, the one in AppController won't even get called unless you
call parent::beforeFilter() in your subclass.  Finally, the reason
you're getting the error about JavascriptHelper is because you're
doing too many things wrong, which has created too many Cake errors,
and Cake is freaking out.  It's trying to render an error page, but
it's using your default layout, which contains a reference to
JavascriptHelper, which hasn't been loaded (Cake only loads the
minimum amount of stuff when something really, really bad happens).

On Feb 3, 9:03 pm, "Vu Nguyen" <[EMAIL PROTECTED]> wrote:
> I have to use some custom query in my Permission_Authentication
> component (which is always loaded before any controller using
> beforeFilter in app_controller), so I need to use ConnectionManager
> each time I load this component.
> (If there is any other way to do custom query please do tell me)
>
> I tried var $components  = array('ConnectionManager'); in my compenent
> and the suddenly get this error out of no where:
> "Notice: Undefined variable: javascript in F:\xampplite\htdocs\linkrepo
> \app\views\layouts\default.thtml on line 33
>
> Fatal error: Call to a member function link() on a non-object in F:
> \xampplite\htdocs\linkrepo\app\views\layouts\default.thtml on line 33"
>
> The line in default.thtml is just :
> <?=$javascript->link(array('prototype', 'event-selectors')); ?>
>
> which works fine if I don't load ConnectionManager.
>
> I tried to put $components  = array('ConnectionManager'); in
> app_controller instead and get exactly the same error.
>
> Anyone knows the cause of this strange error?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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