Class TipyController
C in MVC. Receive the request, fetch or save data from a models, and use a TipyView to create HTML output
// app/controllers/BlogController.php class MyController extends TipyController { public function myAction() { // your application logic } }
Application input is available in $this->in, application output goes to $this->out
Default template rendering
At the end of the action HTML template will be rendered automatically. Automatic template name is contructed from controller name (without "Controller") and action name
Action Template Path ------------------------------------------ BlogController::index() /app/views/Blog/index.php BlogController::post() /app/views/Blog/post.php
Custom template rendering
You can explicitely render template with custom name
// app/controllers/BlogController.php class BlogController extends TipyController { public function article() { $this->out('title', 'Hello'); $this->out('message', 'World!'); $this->renderView('path/to/custom/template'); } }
Disable TipyView rendering
If you use custom template engine or your action outputs formats different from text or HTML you may want to disable default tipy rendering
$this->skipRender = true;
public
|
|
public
mixed
|
|
public
|
|
public
string
|
|
public
|
#
renderView( string $templateName )
Set custom template name for rendering.
This method force controller to render template
even if |
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
public
|
$config
|
|
public
|
$in
|
|
public
|
$out
|
|
public
|
$env
|
|
public
|
$view
|
|
public
mysqli|null
|
$db
|
|
public
|
$session
|
|
public
|
$cookie
|
|
protected
|
$flash
|
|
public
boolean
|
$skipRender
Set this to true to turn off TipyView template rendering |
#
false
|