Can't access controller functions from view.php in remote site.

Permalink
I was working on my first block. In my view.php. I had a code to access functions in the controller like this:

$controller->myfunc();


This is working while I was testing it on my localhost but this did not work in the live site. On the live site, I had to use view() function in the controller to create variables and use them in view.php.

It's probably a bad practice to call the controller functions from view.php directly but I was wondering why this worked on my localhost and not on the live site.

BlueFractals
 
Job replied on at Permalink Reply
Job
From the view the controller can be accessed like this.

$this->controller->myfunc();


Hope this helps.

Job.