Hi, Im trying to get beforeExecuteRoute function to fire on a controller loaded into a micro mvc application but no matter what i try it doesnt want to work. Here are the relevant pieces of code from the controllers, is there something i need somewhere else to initialise the before execute route?
Charities controller
<?php
namespace LoaflyAPI\Controllers;
use \LoaflyAPI\Exceptions\HTTPException,
\LoaflyAPI\Models\Charities as Charities,
\LoaflyAPI\Models\Appeals as Appeals;
class CharitiesController extends RESTController{
public function beforeExecuteRoute() {
var_dump("Before Charities");
}
public function initialize() {
var_dump("Initialize");
}
public function get(){
if($this->isSearch){
$results = $this->search();
} else {
$charities = Charities::find();
$results = array();
foreach ($charities as $charity) {
$results[] = $charity->getJsonArray();
}
}
return $this->respond($results);
}
<omitted>
}
Rest Controller,
<?php
namespace LoaflyAPI\Controllers;
use \LoaflyAPI\Exceptions\HTTPException;
class RESTController extends \LoaflyAPI\Controllers\BaseController{
<ommitted>
}
Base Controller
<?php
namespace LoaflyAPI\Controllers;
class BaseController extends \Phalcon\Mvc\Controller{
}