eater / glim
The glim frontend skeleton
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- hassankhan/config: 0.10.0
- monolog/monolog: 1.18.1
- propel/propel: 2.0.0-alpha5
- slim/slim: 3.3.0
- twig/twig: 1.6.5
This package is auto-updated.
Last update: 2024-10-29 04:31:08 UTC
README
Adding more glamour to Slim
What is it?
Glim HSVM model build around Slim, Propel and Twig.
HSVM
I totally just made that up but it stands for Handler Service View Model
Handler
A handler is like a controller but only handles one request, every route has it's own handler.
An example handler would look like
<?php namespace Eater\Glim\Handler; class Login extends Main { function handle() { $user = this->get('user'); $user = $user->login($this->post('username'), $this->post('password')); if ($user === false) { return "Login failed"; } else { return "Welcome, {$user->name}"; } } }
Service
A service is an class exposing several functions around a certain subject
for example here we have the user service
<?php namespace Eater\Glim\Service; class User extends Main { function login($username, $password) { if ($username == "4" && $password == "2") { $user = new \stdClass(); $user->name = "Towel"; return $user; } return false; } }
View
The view, written in twig
Model
The model, generated by propel