All views are stored in the views
directory. For create the new view file don't forget to add .blade.php
after the name of file. For example register.blade.php
. Because FYLite using Blade as template engine.
// SomeController.php
public function hello()
{
return view('welcome'); // welcome.blade.php
}
public function hello()
{
$name = 'Biobii';
$age = 20;
return view('welcome', ['name' => $name, 'age' => $age]);
}
// welcome.blade.php
<p>My name is {{ $name }}</p>
<p>I'm {{ $age }} years old</p>
FYLite has a helper that makes it easy to call asset files in public folder.
// load assets
<head>
<title>FYLite</title>
<link rel="stylesheet" href="{{ asset('css/style.css') }}">
</head>
// go to specific URL
<form action="{{ myurl('login') }}" method="POST">
{!! csrf_token() !!}
//
</form>
Back to Home