开发者

Need a controller named "directory" in codeigniter

I need my controller to be name "directory" so I can have urls for my busin开发者_运维技巧ess directory page like "mysite.com/directory". But the problem is that "directory" is a predefined php class, so I cannot declare it again. It gives error

Fatal error: Cannot redeclare class Directory in C:\wamp\www\Logistica\system\application\controllers\directory.php on line 8

Is there a way I can rename my class and controller to something else and still have the "directory" in URL ?


Take a look at CodeIgniter routing

In your case you'll want a route like:

$route['directory'] = "DirectoryImplementationClass";


you can use .htaccess to change the URL. that means your name is something other than directory then you can use Rewrite rules to change the name in URL

reference: htaccess in codeigniter

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜