Tuesday, May 10, 2022

Blade Template #2 | Set Navigation

Simple Navigation (unordered)

  • Type the following code inside the body in app.blade.php.
  • These 2 routes don't exist yet. Head to web.php and type:
  • In controller (prev HelloController.php), create 2 functions about() and service().
  • In browser, you'll get something like this:

Now you have navigation, without any repetition.

Side Note

If you have a route that has a get method and hits controller, and inside of that controller, the only thing you are doing is returning a view with no any other actions, there is a shortcut for that.
  • In the route, you can do this instead:
  • Refresh your browser and everything works well. Except now you don't have to use a controller.
This is a shortcut to get a view in your page right away.

End

No comments:

Post a Comment

Komen atau sebarang pertanyaan di sini :)

WordPress #3 | How to Change Website URL

Hi. Today we're gonna look at how to change your website URL in case you messed up. In this case, yes, I messed up. That is why this pos...