php - Codeignighter linking mishap -
im new codeignighter , have been trying make little header, content, footer template.
im having little issue pointing other views. heres got code
my head.php
<html> <head> <title>test header</title> </head>
my content (main.php)
<body> <a href="views/page1.php">hello world</a> <a href="page2.php">link2</a> <br><br>
my footer.php
footer </body> </html>
now whole deal im having want link inner page (page1.php), have setup php file in views folder
page1.php
<?php $this->load->view('head'); ?> <a href="main.php">back</a> <br><br> <?php $this->load->view('footer'); ?>
i able make subpages , inject header , footer them. everytime try linking page1.php main, message "the requested url /ci_test/views/page1.php not found on server." file there?
im bit confused, appreciated!
try using <?=site_url('page1.php')?>
in main.php:
<a href="<?=site_url('page1.php')?>">hello world</a>
but it's problem due routing , .htaccess mod_rewrite. codeigniter work, .htaccess file tells server reroute requests (with few exceptions depending on setup) index.php, , codeigniter routes request corresponding controller renders view.
try reading ci documentation, e.g. static pages: http://ellislab.com/codeigniter/user-guide/tutorial/static_pages.html
Comments
Post a Comment