https://github.com/baylorrae/borealis
https://github.com/baylorrae/borealis
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/baylorrae/borealis
- Owner: BaylorRae
- Created: 2010-08-02T03:57:36.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2010-08-03T02:17:04.000Z (almost 16 years ago)
- Last Synced: 2026-04-04T01:42:03.801Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 199 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Borealis is still being built, but if you want to work on it here is the run down.
### Database
All database interactions are handled with [PHP ActiveRecord](http://www.phpactiverecord.org/) and the models are place in `system/models`
### Routes
Routes are created in `config/routes.php` with the following syntax.
$Map->connect('/product/:slug', array(
// (optional) (default = true) allows different types of formats (.json, .xml)
'allow_formats' => true,
// (optional) (defaults to config) the default format to load
'default_format' => 'json'
));
The first parameter is the route and the second are the options. The above code includes all the options currently available.
Inside the route you may notice `:slug`. This will create a variable accessed via `$params['slug']`
If you went to `http://example.com/product/ballpoint-pen` in your browser Borealis would try to load the product page in the following hierarchy.
1. `app/public_pages/product.php` (optional)
2. `public/product.php`
The first file is used to make a dynamic page that doesn't exist on the server. The file requires the following class
hello_world = 'hi';
// We can also access the params variable
if( $this->params['slug'] )
echo $this->params['slug'];
}
function json() {
}
}
If you create a dynamic page Borealis will automatically try to load the file `public/product.php` if the file exists
## TODO
1. Make it easier to add models
2. Start working on the admin page
*This isn't everything to do, just the important stuff right now*