Book Image

FuelPHP Application Development Blueprints

By : Sebastien Drouyer
Book Image

FuelPHP Application Development Blueprints

By: Sebastien Drouyer

Overview of this book

Table of Contents (13 chapters)
FuelPHP Application Development Blueprints
About the Author
About the Reviewers

Implementation of the to-do list

Now that we explained the essential ORM features and implemented our relations, it is finally time to build our to-do list. This section assumes you have executed the complete public/test.php script at least once.

Allowing the user to see and change tasks' status

First, we will display the associated tasks when viewing a project's details. For instance, this web page should display all tasks of project with id = 2 after the project's name:

In order to do that, we can, as we did in Chapter 1, Building Your First FuelPHP Application, dissect the URL and deduce that, in this case, the view action of the Project controller is executed. The action displays project/view; thus, we have to edit APPPATH/views/project/view.php. Add the following code under the first paragraph displaying the project's name:

<?php echo render('task/list', array('project' => $project)); ?>

The render(...) method is an alias for View::forge(....