Hey, guys!
I created an abstract class with some static methods. In one of these, I get the DI calling \Phalcon\DI::getDefault(). But when I get the router and call wasMatched(), it always returns false.
Like this:
abstract class Utils
{
public static function isMenuAtivo($routeName, $params = array())
{
$di = \Phalcon\DI::getDefault();
if ($di->getRouter()->wasMatched()) { // always returns false
...
}
return false;
}
}
In any controller, the method returns the expected result. Anyone knows what I'm doing wrong? I'm using phalcon 1.3.2.
Thanks.