Book Image

PhpStorm Cookbook

By : Mukund Chaudhary
Book Image

PhpStorm Cookbook

By: Mukund Chaudhary

Overview of this book

Table of Contents (16 chapters)
PhpStorm Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a view with Symfony


You can skip this section if you have planned to use Symfony to create a command-line software. But if you want to write software where you need to show beautiful presentation, you need to follow this section very carefully. The face of your application is known as view.

Getting ready

You need to create views in a particular directory if you stick to the default Symfony settings. The name of the directory in the present installation is <Project-root>/symfony/src/Acme/DemoBundle/Resources/views. You also have to create a directory that contains the name of the controller minus the word controller. Thus, you will create a directory with the name Cooking as you created a controller with the name CookingController.

How to do it...

While naming the file, you have to keep in mind that you will name the view file with the extension .html.twig, and the filename will be the same as the name of the action minus Action, which will render the view.

So, you can have views...