Call a controller method from a Job?

Permalink 1 user found helpful
Hi

is it possible to call a Controller method from a Job?

As it's a job, the required controller isn't loaded I guess, so I think I'll need to create a controller object and then I should be able to call the method inside it.

Any tips to get me started?

Thanks
Russell

russellfeeed
 
russellfeeed replied on at Permalink Best Answer Reply
russellfeeed
Slowing figuring this out, something along the lines of this, I just need to figure out the correct path for the Loader:controller argument.

$cl = Loader::controller('projects/view');
$project_controller = new ProjectsController();
Mnkras replied on at Permalink Reply
Mnkras
$somecontroller = Loader::controller('thing');


should get the controller of a page by path,
or a block's controller, if you want to see the code take a look at
concrete/libraries/loader.php