Я ОЧЕНЬ новичок в CodeIgniter, и мне не удается вызвать функцию из моего класса по умолчанию.Невозможно вызвать функцию класса из URL
Контроллер
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Main extends CI_Controller
{
public function index()
{
$this->welcome();
}
public function welcome()
{
$this->load->view('view_welcome');
}
}
файл .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /pickme/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
# Without mod_rewrite, route 404's to the front controller
ErrorDocument 404 /index.php
В настоящий момент он вызывает этот главный контроллер по умолчанию, как и следовало ожидать.
например
localhost/sitename
AND
localhost/sitename/index.php
AND
localhost/sitename/index.php/main/index
(All have the same result)
Так я был под впечатлением, что
localhost/sitename/class/function/id
бы, как Htaccess будет работать, но им получаю ошибку 404, когда я пытаюсь и доступ
localhost/sitename/main/welcome
У вас есть попробовал http://www.farinspace.com/codeigniter-htaccess-file/ – tomexsans