Hi,
Your solution shouldn't be necessary.
Cake merges $helper, $component and even $uses arrays automatically.
So if you have ...
var $helpers = array('Html','Javascript');
... in your AppController, and ...
var $helpers = array('MyHelper');
... in your child controller, then all three Helpers will be available
in your child controller's views. You should watch out with case
though, the names of the helpers in these arrays should always be
capitalized.



Andrej schrieb:

> As I've got solution I post it to community.
> According to http://www.php.net/manual/en/keyword.parent.php it's
> impossible to access parent variables using parent::
> The only way to access parent variable is _not_ to use same variable
> name in derived class.
>
> So I put a new variable into my custom Controller and wrote constructor
> to merge helper definition arrays.
>
> app_controller.php:
> <?php
> class AppController extends Controller {
>       var $helpers = array('html','javascript');
> }
> ?>
>
> controllers/investors_controller.php:
> <?php
> class InvestorsController extends AppController {
>       var $extendHelpers = array('Child', 'Contact');
>       function __construct(){
>               parent::__construct();
>               $this->helpers = array_merge($this->helpers, 
> $this->extendHelpers);
>       }
> }
> ?>


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