Plan routes to places, get info about the surrounding area, store them offline with the HTML5 offline storage cache manifest. ... Maybe include social elements? Probably not, though.
- Make caching work
- Clean URLs (a.k.a. make .htaccess not break everything)
- Routing, esp. bus routes
- Use more interesting data
- Actually create routes from the email section, if we still want to keep it at all.
- Calendar stuff?
- User accounts?
- Make things shiny!
Add new bits of business logic to the model folder. Add new pages by adding a controller and a corresponding view, probably with the same file names.
- Model: Databases, calculations, all the bits of the code which actually do things. The features.
- View: The HTML templates. They describe how we show our data.
- Controller: Glues the View and Model together. Sends data from Model to View.
- index.php intercepts all page requests.
$page = $_GET['page']- Looks for a class called $pageController in a file called controller/$page.php (this is done in the Controller::load() static function)
- Creates and instance of the class.
- See below
require_once(...)any data/model components you need from the model/ directory.- Runs method
init(). This is the main method you should override. - Runs method
post()orget()depending on the type of request. Overridepost()if you want pages to accept post requests.
Use these methods in the controller to pass data from the model to the view. Here is an example:
<?php
class GeoController {
public $template = "geo"; //Tells the controller to loog in view/web/geo.php for the template
public $title = "Lookup location";
public function init($get) { //$get is provided here for convenience. You could also check $_GET.
$postcode = $get["postcode"]; //Variable NOT accessible by the view.
$point = Geo::LatLongFromPostCode($postcode); //Call method from a model
$this->lat = $point["lat"]; //These variables are accessible in the view.
$this->long = $point["long"];
$this->data["point"] = $point; //If the page is ever requested as JSON, the controller runs encode_json($this->data) and echos it.
$this->jscripts[] = "static/js/thing.js"; //this adds a javascript file to the list of files which will be linked in the <head>
}
}After the init() functions are run, the specified template file is loaded and rendered.
I may have invested a small ammount of time in this readme but that doesn't mean I've decided (yet) if I want to invest the rest of my week.