1. Home
  2. Docs
  3. Developer Documentations
  4. Using views or template files

Using views or template files

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

Hello World

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

Was this article helpful to you? Yes No

How can we help?