Documenation

Views

Views are files that contain layout elements for pages, written in HTML. PHP code can be used but should be limited to presentational logic, all other code belongs in the accompanied Controller. View are always loaded by a Controller and never called directly.

Views are stored in the _view directory.

Example View
1
<p><?php echo $view->siteName ?></p>

Class

$view

Public functions

  • $view->load ( string $file )
    Loads a View.
  • $view->output ( )
    Output loaded views.
  • $view->allow_html ( string $v )
    Decode an HTML entity encoded string.

Public variables

  • $view->rootPath
    Absolute path to the root. Note that this can be different from $contr->rootPath (e.g. when URL rewrites or AJAX is used).
  • $view->viewPath
    Absolute path to the View directory (/_view).
  • $view->siteName
    Name of the website (value of $model->siteName, safe for HTML).
  • $view->siteCopyright
    Copyright of the website (value of $model->siteCopyright, safe for HTML).
  • $siteDesigner
    Name of the website designer (value of $model->siteDesigner, safe for HTML).
  • $view->pageTitle
    Title of the page (value of $contr->pageTitle, safe for HTML).
  • $view->pageDescription
    Description of the page (value of $contr->pageDescription or $model->siteDescription if missing, safe for HTML).
  • $view->pageKeywords
    Keywords relevant to the contents of the page (value of $contr->pageKeywords or $model->siteKeywords if missing, safe for HTML).
  • $view->inAdmin
    Used to distinguish between regular and administrative pages.