Welcome to TinyMVC, the tiny PHP Framework.

Extending TinyMVC Classes

Learning by example

Lets extend the TinyMVC_Controller class:

myapp/plugins/my_controller.php

class My_Controller extends TinyMVC_Controller
{
  function __construct()
  {
    parent::__construct();
  }
  // do your class extensions here
}

Then in your controllers, just extend your custom controller:

class Hello_Controller extends My_Controller
{
  function index()
  {
    $this->view->display('hello_view');
  }
}


You do not need to include your extension file, TinyMVC will autoload it so long as the file is named after the class in lower case (my_controller.php) in the plugins directory.

The same procedure applies for extending TinyMVC_Model and TinyMVC_View.


TinyMVC is licensed under the GNU LGPL license.
This page was rendered in 0.00039 seconds.