Yii 1 Yii :: import不起作用,但包含do

时间:2019-04-07 17:04:32

标签: php yii include

我已经更改了我的提供商,现在出现了这个错误

  

致命错误:找不到类'GxController'   /home/clients/bbbf03544f22c763cd3acfefa31454be/web/protected/controllers/SiteController.php   在第6行

我以前是这样输入的:

Yii::import(‘application.components.GxController);

现在我必须做

include Yii::app()->getBasePath().'/components/GxController.php';

有什么主意吗?我不想更改所有代码。

在我使用php 5.4和5.6之前

非常感谢..

1 个答案:

答案 0 :(得分:0)

我用.htaccess文件修复它:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php [L]