update docs/examples
This commit is contained in:
parent
51867226be
commit
2658600afe
|
@ -29,7 +29,7 @@ There are **better options** out there now
|
|||
|
||||
### Requirements
|
||||
|
||||
- PHP 5.3+
|
||||
- PHP 5.4+ ([], php -S)
|
||||
|
||||
|
||||
## Usage
|
||||
|
@ -38,6 +38,8 @@ Create an `index.php` file and put the following code in it
|
|||
|
||||
```php
|
||||
|
||||
<?php require(PATH_TO_MITE);
|
||||
|
||||
class Prototype extends Mite {
|
||||
|
||||
function index()
|
||||
|
@ -61,6 +63,5 @@ The file name as `index.php` is important for routing
|
|||
|
||||
- More Examples
|
||||
- Document API
|
||||
- Modernize (ditch 5.2), but remain small
|
||||
- Mite DB construct take PDO object, not build one
|
||||
- Support REST functionality
|
|
@ -1,13 +1,13 @@
|
|||
<?php require('../vendor/autoload.php');
|
||||
<?php require(__DIR__ . '/../src/mite.php');
|
||||
|
||||
/*
|
||||
* Example: 5.3 OOP Anonymous Functions
|
||||
*/
|
||||
|
||||
$app = new Mite(array('debug' => TRUE, 'index' => __FILE__));
|
||||
$app = new Mite(['debug' => TRUE, 'index' => __FILE__]);
|
||||
|
||||
$app->route('/', function() use($app) {
|
||||
$app->view('views/index.tpl.php');
|
||||
$app->route('/53oop.php', function() use($app) {
|
||||
$app->view('index.tpl.php');
|
||||
});
|
||||
|
||||
$app->run();
|
|
@ -1,4 +1,4 @@
|
|||
<?php require('../vendor/autoload.php');
|
||||
<?php require(__DIR__ . '/../src/mite.php');
|
||||
|
||||
/*
|
||||
* Example: Using MITE as a base class
|
||||
|
@ -7,10 +7,10 @@ class test extends Mite {
|
|||
|
||||
function index()
|
||||
{
|
||||
$this->view('views\index.tpl.php');
|
||||
$this->view('index.tpl.php');
|
||||
}
|
||||
}
|
||||
|
||||
$app = new test(array('debug' => TRUE, 'index' => __FILE__));
|
||||
$app->route('/', 'index');
|
||||
$app = new test(['debug' => TRUE, 'index' => __FILE__]);
|
||||
$app->route('/extend.php', 'index');
|
||||
$app->run();
|
Loading…
Reference in New Issue