Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class RobotsController extends Phalcon\Mvc\Controller
public function index()
echo "Hello Index";
public function show($id)
echo "Hello Show $id";
$loader = new \Phalcon\Loader();
$app = new Phalcon\Mvc\Micro();
$robotsController = new RobotsController();
//Retrieves all robots
$app->get('/', array($robotsController, 'index'));
$app->get('/robots', array($robotsController, 'index'));
$app->get('/robots/show/{id}', array($robotsController, 'show'));

This comment has been minimized.

Copy link

prakasa1904 commented Oct 25, 2016

but we cannot use service from $di in controller, Im already done with that.. still not work to access $this->response or $this->request from controller ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.