orinoco framework is a light full-stack web framework written in PHP5. It is based on MVC architecture and implements the Model 2 design pattern. Its infrastructure helps developers create a clean and maintainable applications.
Framework's Features
- Framework
- Full-stack framework (Model, View and Controller)
- Extremely lightweight
- Easy to install and very easy to configure
- Clean and organized directory structure
- Classes can be easily extended
- Integrated Object-relational mapping (ORM)
- Multiple table query support
- CRUD functionalities
- Rich record and data helper
- Supports various RDMS (PostgreSQL, SQLite, etc.) Under Development
- Supports and tested for MySQL
- Search engine friendly URL scheme
- Customizable route and URLs
- Work with various AJAX frameworks and javascript libraries (jQuery, Prototype, Scriptaculous, Dojo, etc.)
Framework's Structure
Download source file
Latest branch source: 0.1.5
svn checkout http://orinoco-framework.googlecode.com/svn/branches/0.1.5/ orinoco-framework-0.1.5
Framework in action!
Here's an overview of orinoco framework's technical code structure. Please see the tutorial page for a more detailed documentation.
Models
For this example, we'll use two (2) models (employee and position) to map two (2) existing table called employee and position.
/apps/default/models/employee.model.php
class employee extends Record {
// lists of table fields and its associated table/model
public $id = array('primary' => true);
public $first_name;
public $last_name;
public $address;
public $phone;
public $position_id = array(
'model' => 'position',
'join' => 'right'
);
}/apps/default/models/position.model.php
class position extends Record {
// lists of table fields
public $id = array('primary' => true);
public $position_name;
}Controller/Action
/apps/default/controllers/employee.controller.php
class employeeController extends Controller {
function __index__() {
$this->employee->find(); // one line query; find all records
}
}View
/apps/default/views/contents/employee/__index__.view.php
<table>
<tr>
<td><b>First name</b></td>
<td><b>Last name</b></td>
<td><b>Address</b></td>
<td><b>Phone</b></td>
<td><b>Position</b></td>
</tr>
<?php while($this->employee->iterate()) { ?>
<tr>
<td><?php echo $this->employee->first_name->link_id_to('edit'); ?></td>
<td><?php echo $this->employee->last_name; ?></td>
<td><?php echo $this->employee->address; ?></td>
<td><?php echo $this->employee->phone; ?></td>
<td><?php echo $this->employee->position_name; ?></td>
</tr>
<?php } ?>
</table>The Result
| First name | Last name | Address | Phone | Position |
| Moe | Howard | Somewhere | 888-9999 | Project Manager |
| Curly | Howard | Anywhere | 999-7777 | Software Engineer |
| Larry | Fine | Nowhere | 777-8888 | Graphic Designer |
NOTE: orinoco framework is currently under heavy development. So it is not yet recommended for production use, but instead you could try mature and stable frameworks such as: Symfony, Ruby on Rails, Django, etc.