Hello there,
since 1 week i started to get into the whole MVC World. And because my understanding of it equals null i was unsuccessful with CakePHP, Symfony or Laravel. Then i found the Codeigniter.
I was experimenting with Routing and AJAX and Controllers and now i want to make myself a template in the Views folder. I tried to include the so called header.php and footer.php in my home.php page but i doesn't work. After some research i found out that in Codeigniter you can't just do an include like in conventional php.
After another research i found a way to do it but my Codeigniter seems to not recognize the method i am using although for everyone else works without for them to do anything.
My Code looks like this:
PHP Code:
<?php namespace App\Controllers;
class Home extends BaseController
{
public function index()
{
$pageData = [
'header' => $this->load->view('header.php', NULL, TRUE),
'footer' => $this->load->view('footer.php', NULL, TRUE),
'tabTitle' => 'Online Shop MTFKS!'
];
return view('home.php', $pageData);
}
//--------------------------------------------------------------------
}
This call $this->load seems not to be existent. My PHPStorm throws me an error everytime i click on it.
I am stuck and i don't know how can i go further.
I have to mention that when i installed the Codeigniter Framework i just downloaded it and extracted it in my project folder as mentioned in the Docs. Then i followed the docs to finish setting it up. But somehow i think something is missing. And whenever i try to install it composer it just doesn't run, my powershell is stuck on an empty line.
When i run this code my website just gives me the standard CI Whoops! Error.
Thank you !