Book Image

Learning Phalcon PHP

By : Calin Rada, Ioan C Rada
Book Image

Learning Phalcon PHP

By: Calin Rada, Ioan C Rada

Overview of this book

Table of Contents (17 chapters)
Learning Phalcon PHP
About the Author
About the Reviewers

Creating the structure for our project

Now, we are going to create the structure for our project. In the first chapter, we created the /var/www/learning-phalcon.localhost folder. If you have another location, go there and create the following directory structure:

Next, let's create the index.php file that will handle our application. This file will be the default file in our web server:


header('Content-Type: text/html; charset=utf-8');

require_once __DIR__.'/../modules/Bootstrap.php';

$app = new Bootstrap('frontend');

In the first two lines, we set the header and internal encoding to UTF-8. This is a good practice if you are going to use special characters / diacritics. In the fourth line, we include a file named Bootstrap.php. This file is the Bootstrap of our project, and we will create its content in a few moments. On the next lines, we create a new instance of Bootstrap with a default module (frontend), and we initialize...