We have now done the preliminary steps: we installed FuelPHP, configured it, generated the scaffold for managing the projects, and created the task model. We didn't connect the two models though, and we haven't yet displayed tasks anywhere. More importantly, we haven't explained how to load objects until now. This is the aim of this section.
As we explained earlier, we used oil to generate code, but instead of using scaffold/crud
as in Chapter 1, Building Your First FuelPHP Application, we used scaffold/orm
and model/orm
. If you take a look at the files (controllers, views, and models), you will only see minor changes, except for the model files:
The
$_table_name
attribute is no longer declared. It is still used byOrm\Model
though, but it takes a default value that depends on the model name, so you can still define it if you want to use a custom table name.The
$_properties
attribute has been added. This attribute contains all...