Responses
HTML Response
<?php
use sa\application\controller;
use sa\application\responses\View;
class UserController extends controller {
public function index() {
// Use master theme.
// Render the '/{module}/views/user_list.php' view
$html = new View('master', 'user_list');
// Pass variables $first_name and $last_name into HTML view.
$html->data = array('first_name' => 'John', 'last_name' => 'Doe');
// Render the view
return $html;
}
}Constructor Parameters
JSON Response
Constructor Parameters
XML Response
Constructor Parameters
File/Binary Response
Constructor Parameters
HTTP Redirect
Constructor Parameters
Custom Responses
The Response Interface
The Response Trait
Custom Response Example
Downloading Files
The Downloadable Response Trait
Download JSON
Download XML
Download Files
Last updated