Creating and using a basic view
In this recipe, we'll see some basic view functionality and how we can include views in our app.
Getting ready
For this recipe, we need a standard Laravel installation.
How to do it...
Follow these steps to complete the recipe:
In the
app/views
directory, create a folder namemyviews
.In the new
myviews
directory, create two files:home.php
andsecond.php
.Open
home.php
and add the following code in HTML:<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Home Page</title> </head> <body> <h1>Welcome to the Home page!</h1> <p> <a href="second">Go to Second Page</a> </p> </body> </html>
Open the
second.php
file and add the following code in HTML:<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Second Page</title> <...