The following model extends on Dbi().
Dbi()
use Stilmark\Database\Dbi; class User extends Dbi { const table = 'users'; }
Use the model from a controller.
use WebApp\Model\User; class UserController extends Request { function index() { return User::limit(100)->list(); } function show() { return User::get( Request::arg('id') ); } }
Last updated 8 months ago