First App

Keeping it simple

  • The default controller is called home
  • The default controller action is index this relates directly to a public function in the controller:
  • The simplest controller would be:

    <?php
        class hello extends Controller {
            function index() {
                print 'hello<br />';
               
        }
        
    }
    

    <?php
        class hello extends Controller {
            function index() {
                $p = new dvc\pages\bootstrap;
                    $p
                        ->header()
                        ->title();
                        
                    $p->primary();
                        print 'hello<br />';
                        
                    $p->secondary();
                        print 'secondary';
               
        }
        
    }
    

TIP: Disabling Documentation

  • If you create a controller called docs - it will disable this documentation, which on a production application may be what you want
  • Alternatively : Create a folder in your application/views folder - docs
    • ie: application/views/docs and create content there, start with contents.md which will disable the docs folder