How to create templates |
Which version of CodeIgniter are you using?
If it's the latest CI4 - templating is very easy. Take a look at this - https://codeigniter4.github.io/userguide...youts.html Step 1 - create your template file - Views/app.php PHP Code: <!doctype html> Step 2 - create any page e.g. home page Views/homepage.php PHP Code: <?= $this->extend('app') ?> //This is the name of layout file above without ".php" Step 3 - In your controller PHP Code: public function index() Depending upon your are requirements - you can create different types of layouts e.g. publicLayout.php or adminLayout.php You can also include partials too - check out all options here - https://codeigniter4.github.io/userguide/outgoing |
Messages In This Thread |
How to create templates - by mitsol - 04-17-2019, 08:10 AM
RE: How to create templates - by php_rocs - 04-17-2019, 03:35 PM
RE: How to create templates - by website - 04-18-2019, 04:53 AM
RE: How to create templates - by happyape - 04-18-2019, 05:29 AM
RE: How to create templates - by soap - 04-19-2019, 01:19 AM
RE: How to create templates - by HelenM - 04-19-2019, 03:03 AM
RE: How to create templates - by vincent78 - 04-20-2019, 03:10 AM
|