Skip to content

Instantly share code, notes, and snippets.

@andevsoftware
Last active February 28, 2016 19:47
Show Gist options
  • Save andevsoftware/62d86518ddad316b2725 to your computer and use it in GitHub Desktop.
Save andevsoftware/62d86518ddad316b2725 to your computer and use it in GitHub Desktop.
Phalcon REST - Create array response
<?php
class CustomController extends \PhalconRest\Mvc\Controller\Fractal
{
public function authenticate() {
// Authentication code here
// We've successfully created a session
return $this->createArrayResponse([
'token' => $session->getToken(),
'expires' => $session->getExpirationTime()
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment