Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit
https://github.com/akelos/akelos/issues
Akelos PHP Framework Forum
Discussions
Categories
Akelos Programming
: Undefined property: UrlHelper::$_controller
Bottom of Page
1 to 2 of 2
CommentAuthor
anagram
Hi guys, i've got another problem here. Well, i've created a new helper called ApplicationHelper (application_helper.php) in app/helpers directory.
-----------------------------------------------------------------------------------
<?php
class ApplicationHelper
{
function setElementClass($element) {
$class = '';
$helper = new UrlHelper;
if ($helper->current_page(array('controller' => $element))) {
$class = 'active';
}
return $class;
}
}
?>
---------------------------------------------------------------------------------------------------
When i called setElementClass, i got this error :
Undefined property: UrlHelper::$_controller
I've been stuck for about 1 hour (tracing akelos php source), please could anyone give me solutions?
Thanks ....
CommentAuthor
arnoschn
The url helper needs the Controller instance.
try this, extending the url_helper and reusing its functionality inside.
class ApplicationHelper extends UrlHelper
{
function setElementClass($element) {
$class = '';
if ($this->current_page(array('controller' => $element))) {
$class = 'active';
}
return $class;
}
}
1 to 2 of 2
Back to Discussions
Top of Page