Using Menu in CI |
[eluser]Unknown[/eluser]
After searching the forum for answers I decided to post my problem. I never used any framework to develop application in PHP. I created a test app to learn CI. Direct to the point. My file structure, comments in brackets: + ci_sjc (I rename code igniter folder) + system + application (I understand you can move your application folder) + controller - sjc.php (my controller file) + libraries - sjc_menu.php (my menu class) + views - sjc_emp_input.php - sjc_footer.php - sjc_header.php - sjc_main.php - sjc_menu.php Code in my config.php Code: $config['base_url'] = "http://localhost/ci_sjc/"; Code in my autoload.php Code: $autoload['libraries'] = array('database', 'session'); Code: $route['default_controller'] = "sjc"; Code fo my sjc_menu.php (libraries) Code: <?php My controller code sjc.php Code: <?php my views files - sjc_main.php Code: <html> sjc_input.php Code: <html> sjc_menu.php Code: <?php sjc_header.php Code: <?php Code: <?php Tested the application http://localhost/ci_sjc/ it works as expected i.e. it displayed the header, the menu and the footer. Problem is when I click any of the link in the menu it gives an error Not Found The requested URL /ci_sjc/index was not found on this server. I need someone to suggest where I did wrong in the coding above. All the coding above I picked up from various toturial on the net. Thank you.
[eluser]Fabdrol[/eluser]
Few things: Code: $this->load->library('sjc_menu'); That is not the CodeIgniter way. Load it like this: Code: public function __construct() { The problem however, is not related to that. Try adding the following to config.php: Code: $config['index_page'] = "index.php";
[eluser]toopay[/eluser]
take a look at user guide, at this section http://ellislab.com/codeigniter/user-gui.../urls.html, and http://ellislab.com/codeigniter/user-gui...elper.html hope that help you.
[eluser]InsiteFX[/eluser]
Also you should not have a input method, it maybe confusing CodeIgniters input library. InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |