Wednesday, May 2, 2012

Re: $this->Params['controller'] doesn't work in cakephp component

in your __construct() method for component, first parameter is ComponentCollection $collection object.
From here you can store controller to component like
$this->Controller = $collection->getController();

then params you have in $this->Controller->params
--
Lep pozdrav, Tilen Majerle



2012/5/2 Cruisine <cruisine87@yahoo.co.id>
hi guys...i need to know how to get current controller from cakephp
component....
i tried to use $this->Params['controller'] on my component but it
keeping me get error message like this :

Notice (8): Undefined property: DynRubrikComponent::$params [APP
\controllers\components\dyn_rubrik.php, line 17]

do u guys know how to deal with this matter ? need ur help very
soon...thank u..

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: