O'Reilly logo

Learning FuelPHP for Effective PHP Development by Ross Tweedie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Views

When creating the controller with the Oil tool, a template and views are also created. Let's have a look at one of the views, load fuel/app/views/entry/index.php.

You will notice the lack of opening and closing HTML body in the view. The test of the presentation elements are handled by the template.php file found in the root of the views folder. Before looking at template.php, let's discuss some of the parts of the index.php file:

Arr::get( $subnav, "index");

As shown in the preceding line of code, it is using the core FuelPHP Arr class, which is a set of helper functions for working with arrays. In this instance, the get method is used. This allows you to check for a given key in an array, it then returns false if the key can't be found. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required