i have a problems white this sentence:
codeigniter/app/view/autos.php
``` extend('front\layout\main') ?>```
In my local hosting works, but when change to my share server (cpanel), not works.
codeigniter/app/Controllers/Auto.php
``` public function index() { helper('tiempo'); $autoModel = new AutoModel($db); $autos = $autoModel->findAll(); $autos = array('autos' => $autos); $estructura = view('front/autos', $autos); return $estructura; } ```
``` <?= $this->extend('front\layout\main') ?> <?= $this->section('title') ?> <?= $this->endSection() ?> <?= $this->section('content') ?> ```
``` <head> <title>Tables - SB Admin</title> <title><?= $this->renderSection('title') ?></title> </head> <?= $this->include('front\layout\header') ?> <?= $this->renderSection('content') ?> <?= $this->include('front\layout\footer') ?> <?= $this->renderSection('js') ?> <script src="js/jquery-3.5.1.slim.min.js"></script> <script src="js/bootstrap.bundle.min.js"></script> <script src="js/scripts.js"></script> <script src="js/jquery.dataTables.min.js"></script> <script src="js/dataTables.bootstrap4.min.js"></script> <script src="assets/demo/datatables-demo.js"></script> </body> ```
Is my first post plz take easy
Welcome to SO Enzo. First of all, thanks for providing everything to help explain your issue and let us answer it...
So, this can happen when you develop under Windows and then try the same code on an Apache (Linux) Server (You refer to it as Cpanel which is just the Webserver Control Panel).
Developing under Windows allows you to do "things" as it's rather "relaxed" in what it will let you do. On the other hand, Linux is not, which is a good thing.
So let's take a walk through your code...In one place you have used
$estructura = view('front/autos', $autos);
That works and you should note that it uses / (forward slashes).
In the place where the error is and which is clearly stated in the error message is
<?= $this->extend('front\layout\main') ?>
Playing "Spot the Difference" here, you might ask yourself "Why do I have code where the slashes go one way and code where the slashes go the other way? AND Where it's showing an error the slashes are going \ i.e.backslashes.
Now you know 100% that the file exists. So the words are right in the path but why are the slashes (backslashes) \ here where it errors and / (forward slashes) it works?
There's a clue.
Under Linux, File paths need to be / (forward slashes). While windows, using XAMPP or WAMP etc, will let you use both as you have seen.
Windows is also "relaxed" when it comes to the Case of Path and Filenames. Linux is NOT which is another trap to look out for.
I.E if you had a path of /front/layout/main, you can reference this as /Front/layout/MAIN and any other combination of Upper and Lower Case characters which would work ONLY in windows. Under Linux, they must match exactly.
Conclusion
Where you have path names using \ (backslashes)
extend('front\layout\main') ?>
Use / (Forward Slashes)
extend('front/layout/main') ?>
I hope that helps. If it does not, then feel free to ask.