CodeIgniter Forums
How can i viewed a static page with CI4 ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10)
+--- Thread: How can i viewed a static page with CI4 ? (/showthread.php?tid=81091)



How can i viewed a static page with CI4 ? - yasintheking - 01-23-2022

I'm calling the file called booking.php with Codeigniter 4, but I'm getting an error. Although I add the following lines to Home Controller, the page does not appear, where am I going wrong?

public function booking()
{
$this->load->view('Partials/home/head');
$this->load->view('Home/booking');
$this->load->view('Partials/home/foot');
}
I'm calling the booking.php file, but it gives an error. as sitename.com/booking

public function index()
{
echoview('Partials/home/head');
echoview('Home/index');
echoview('Partials/home/foot');
}
but I can call index.php as above. Again, I can't call a different /urly like /booking /contact etc


RE: How can i viewed a static page with CI4 ? - sprhld - 01-24-2022

(01-23-2022, 12:21 PM)yasintheking Wrote: but I can call index.php as above. Again, I can't call a different /urly like /booking /contact etc

Can you call .../index.php/booking? Did you changed your htaccess-File?


RE: How can i viewed a static page with CI4 ? - demyr - 01-24-2022

Have you checked Routes file under config?