Help & KnowledgeBase

Using Views or Templates files

View files reside in html/ folder of your plugin and can be call using the view()  function as you will see below

create a file at html/ folder call it index.phtml and input the code below

<h1>Hello World</h1>

 Now lets call this view file from our created pager, go to your mypage.php pager and change the code of index_pager function to this

return view('test::index');

You should now see a content in your page 

This view function takes two parameter

  • First Parameter : a string containing the path to the view file and not the plugin test::  in the example above
  • Second parameter: an associative array to pass data to the view file

Thanks for reading