![]() |
controller function dont load - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html) +--- Thread: controller function dont load (/thread-26326.html) |
controller function dont load - El Forum - 01-11-2010 [eluser]mehdy[/eluser] my controller fuction is now working . but my index load perfectly. config.php $config['base_url'] = "http://localhost/codeigniter/"; $config['index_page'] = ""; route.php $route['default_controller'] = "test"; my controller text.php <?php class Test extends Controller { function Test() { parent::controller(); } function index () { echo $this->load->view('test'); } function check (){ echo "ee"; } } my view file text.php <html> <head> <title></title> <meta http-equiv = "Content-Type" content = "text/html ; charset =UTF-8" > </head> <body> <div id ="container" > <?php echo "gggg"; echo anchor('test/check' ,'new'); ?> </div> </body> </html> when i click link , it shows The requested URL /codeigniter/test/check was not found on this server. please help me . controller function dont load - El Forum - 01-11-2010 [eluser]JHackamack[/eluser] Unless you used mod rewrite to hide the index.php $config[‘index_page’] = “”; should be $config[‘index_page’] = “index.php”; and you should call: /codeigniter/index.php/test/check controller function dont load - El Forum - 01-11-2010 [eluser]mehdy[/eluser] thank you . but still no change . my previous configuration config.php $config['base_url'] = "http://localhost/codeigniter/"; $config['index_page'] = ""; routes.php $route['default_controller'] = "test"; autoload.php $autoload['libraries'] = array('database','session','email','validation'); $autoload['helper'] = array('url','form','text','date','security'); htaccess.txt RewriteEngine on RewriteCond $1 !^(index\.php|images|captcha|css|js|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] /codeigniter/system/application/controllers/ i have connect with db , do i need to change any configuration ? controller function dont load - El Forum - 01-11-2010 [eluser]JHackamack[/eluser] I see in your initial post you named your file "Text.php" "my controller text.php " but called the controller Test Make sure both are the same file names controller function dont load - El Forum - 01-12-2010 [eluser]Rick Jolly[/eluser] You are using a subdirectory. Add RewriteBase to your htaccess file. Also, try dropping the slash before "index.php/$1": Code: RewriteEngine on controller function dont load - El Forum - 01-12-2010 [eluser]mehdy[/eluser] thank you , yes i have chaged my htaccess file as u told , and my controller name is Test and file name is test , still no change , same error controller function dont load - El Forum - 01-12-2010 [eluser]JHackamack[/eluser] Does it come back with: http://localhost/codeigniter/test/check was not found? is it the browser 404 error message or a code igniter styled error message? controller function dont load - El Forum - 01-12-2010 [eluser]mehdy[/eluser] The requested URL /codeigniter/test/check was not found on this server. |