Views contain the HTML served by your application and separate your controller / application logic from your presentation logic. Views are stored in the resources/views directory.
A simple view might look something like this:
Since this view is stored at resources/views/greeting.php, we may return it using the global view helper function like so:
As you can see, the first argument passed to the view helper corresponds to the name of the view file in the resources/views directory. The second argument passed to helper is an array of data that should be made available to the view. In this case, we are passing the name variable, which is displayed in the view by simply executing echo on the variable.
Of course, views may also be nested within sub-directories of the resources/views directory. "Dot" notation may be used to reference nested views. For example, if your view is stored at resources/views/admin/profile.php, you may reference it like so:
Views contain the HTML served by your application and separate your controller / application logic from your presentation logic. Views are stored in the resources/views directory.A simple view might look something like this:Since this view is stored at resources/views/greeting.php, we may return it using the global view helper function like so:As you can see, the first argument passed to the view helper corresponds to the name of the view file in the resources/views directory. The second argument passed to helper is an array of data that should be made available to the view. In this case, we are passing the name variable, which is displayed in the view by simply executing echo on the variable.Of course, views may also be nested within sub-directories of the resources/views directory. "Dot" notation may be used to reference nested views. For example, if your view is stored at resources/views/admin/profile.php, you may reference it like so:
การแปล กรุณารอสักครู่..
