1

我的 Yii 系统有一些问题。系统中的所有模块都工作正常,但活动模块出现错误。它返回以下错误:

 2013/10/22 10:21:17 [error] [exception.CHttpException.404] exception 'CHttpException' with message '"activity/default/list" isteği çözümlenemedi.' in /var/www/yii/framework/web/CWebApplication.php:286
 Stack trace:
 #0 /var/www/yii/framework/web/CWebApplication.php(141):        CWebApplication->runController('activity/defaul...')
 #1 /var/www/yii/framework/base/CApplication.php(180): CWebApplication->processRequest()
 #2 /var/www/hello/index.php(13): CApplication->run()
 #3 {main}
 REQUEST_URI=/etkinlikler/liste

这是我的活动模块的主要和默认控制器文件。

主文件

 <?php

 date_default_timezone_set('Asia/Istanbul');

return array(
'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
'name' => 'Kendim Panel',
'language' => 'tr',
'preload' => array('log'),
'import' => array(
    'application.models.*',
    'application.modules.*',
    'application.components.*',
    'application.helpers.*'
),
'modules' => array(  
    'gii' => array(
        'class' => 'system.gii.GiiModule',
        'password' => '121212',
        'ipFilters' => array('127.0.0.1, 192.168.1.27', '::1'),
    ),
    'wlapi' => array(),
    'panel' => array(),

    'ileti' => array(),
    'anket' => array(),
    'hastag' => array(),

    'category' => array(),
    'product' => array(),

    'menu' => array(),
    'siparis' => array(),

    'kisisel' => array(),
    'istatistik' => array()
),
'components' => array(
    'CString' => array('class'=>'CString'),
    'myFunc' => array('class'=>'myFunc'),
    'user' => array(
        'allowAutoLogin' => true,
    ),
    'db' => array(
        'connectionString' => 'mysql:host=localhost;dbname=kendim_db',
        'emulatePrepare' => true,
        'username' => 'root',
        'password' => 'root',
        'charset' => 'utf8',
    )
 ,       'urlManager' =>array(
        'urlFormat' => 'path',
        'showScriptName' => false,
        'rules' => array(
            '/' => 'panel/default', 
            'wl-api'                            => 'wlapi',
            'etkinlikler'                       => 'activity',
            'etkinlikler/ekle'                  => 'activity/default/create',
            'etkinlikler/duzenle'               => 'activity/default/update',
            'etkinlikler/duzenle/id/<id:\d+>'   => 'activity/default/update',
            'etkinlikler/sil'                   => 'activity/default/delete',
            'etkinlikler/sil/id/<id:\d+>'       => 'activity/default/delete',
            'etkinlikler/liste'                 => 'activity/default/list',
            'kategoriler'                       => 'category',
            'kategoriler/ekle'                  => 'category/default/create',
            'kategoriler/duzenle'               => 'cateogry/default/update',
            'kategoriler/duzenle/id/<id:\d+>'   => 'category/default/update',
            'kategoriler/sil'                   => 'category/default/delete',
            'kategoriler/sil/id/<id:\d+>'       => 'category/default/delete',
            'kategoriler/liste'                 => 'category/default/list',
            'urunler'                           => 'product',
            'urunler/ekle'                      => 'product/default/create',
            'urunler/duzenle'                   => 'product/default/update',
            'urunler/duzenle/id/<id:\d+>'       => 'product/default/update',
            'urunler/sil'                       => 'product/default/delete',
            'urunler/sil/id/<id:\d+>'           => 'product/default/delete',
            'urunler/liste'                     => 'product/default/list',
        ),
    ),
    'errorHandler' => array(
        'errorAction' => 'panel/default/error',
    ),
    'log' => array(
        'class' => 'CLogRouter',
        'routes' => array(
            array(
                'class'     => 'CFileLogRoute',
                'levels'    => 'error, warning',
            ),
        ),
    ),
    'image'=>array(
        'class'=>'application.extensions.image.CImageComponent',
        //GD or ImageMagick
        'driver'=>'GD',
        'params'=>array('directory'=>'/opt/local/bin',
            'product'=>array(
                    'size'=>array(
                        'detail'=>array(
                            'width' => 418,
                            'height' => 314
                        ),
                        'thumbnail'=>array(
                            'width' => 90, 
                            'height' => 68
                        ),
                        'org'=>array(
                            'width' => 800,
                            'height' => 600
                        ),
                    ),
            ),
        ),
    ),
),
 );
?>

DefaultController.php

 <?php 

 class DefaultController extends ActivityController
 {
public  $layout = 'activity';
private $actionStatus;
private $defaultDetailImageWidth;
private $defaultDetailImageHeight;
private $defaultListImageWidth;
private $defaultListImageHeight;
private $defaultOrgImageWidth;
private $defaultOrgImageHeight;

public function actionCreate() 
{

    $this->pageTitle = "Etkinlik Yönetimi > Etkinlik Ekleme";

    $this->render("create", array('model'=>$newActivityModel, 'actionStatus'=>$this->actionStatus, 'categoryGridList'=>$categoryGridList));
}

public function actionList()
{
    $this->pageTitle = "Etkinlik Yönetimi > Etkinlik Listeleme";

    $this->render("list");
}

public function actionDelete()
{
    $this->pageTitle = "Ürün Yönetimi > Ürün Silme";
    $this->render("delete", array('actionStatus' => $this->actionStatus));
}

public function actionUpdate()
{   
    $this->pageTitle = "Ürün Yönetimi > Ürün Güncelleme";
    $this->render("update", array('model'=>$product, 'actionStatus' => $this->actionStatus, 'categoryList' => $categoryList));
}

public function actionIndex() 
{   
    $this->render("index");
}

public function actionError() 
{   
    $this->render("error");
}
 }

 ?>

活动控制器.php

 <?php

 /**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */

 class ActivityController extends CController {

/**
 * @var string the default layout for the controller view. Defaults to '//layouts/column1',
 * meaning using a single column layout. See 'protected/views/layouts/column1.php'.
 */

public $layout = '/layouts/column1';

/**
 * @var array context menu items. This property will be assigned to {@link CMenu::items}.
 */

public $constants = array();

public $menu = array(
        array('label'=>'Etkinlik Ekle', 'url'=>'/etkinlikler/ekle'),
        array('label'=>'Etkinlik Liste', 'url'=>'/etkinlikler/liste'),
    );

/**
 * @var array the breadcrumbs of the current page. The value of this property will
 * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
 * for more details on how to specify this property.
 */
public $breadcrumbs = array();
 }

我已将所有文件的权限设置为 777,但仍然出现相同的错误。我还检查了系统无法进入控制器。我在 main.php 中得到错误是什么问题?

4

2 回答 2

1

Ok I found the problem. I haven't defined the activity module in main.php After adding 'activity' => array(); the problem was solved.

于 2013-10-22T08:22:19.827 回答
0

改变

array('label'=>'Etkinlik Ekle', 'url'=>'/etkinlikler/ekle'),
array('label'=>'Etkinlik Liste', 'url'=>'/etkinlikler/liste'),

array('label' => 'Etkinlik Ekle', 'url' => array('activity/default/create')),
array('label' => 'Etkinlik Liste', 'url' => array('activity/default/list)),
于 2013-10-22T07:37:43.340 回答