yii2 url nicht gefunden wird angezeigt, während Zugriff auf die controller-action

Habe ich eine controller-Funktion wie

public function actionRateTicket($id){

}

Den urlManager hat die folgende Konfiguration

'urlManager' => [
            'class' => 'yii\web\UrlManager',
            //Disable index.php
            'showScriptName' => false,
            //Disable r= routes
            'enablePrettyUrl' => true,'enableStrictParsing' => true,

            'rules' => array(
                    '<controller:\w+>/<id:\d+>'              => '<controller>/view',
                    '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                    '<controller:\w+>/<action:\w+>'          => '<controller>/<action>',
            ),
        ],

Aber als ich versuchte, Zugang http://mydomainname/web/ticket/rate-ticket/2333 , (ticket ist der name des Controllers(TicketController.php)) es zeigt Not Found (#404) Fehler.

Was ist hier das problem?
Ich bin in der Lage, Zugang zu allen controller-Aktionen mit einem einzigen Kamel-Fall-Charaktere wie actionView, actionEdit etc, aber actionRateTicket, ich bin nicht in der Lage, acess. Wenn die actionRateTicket umbenannt, um actionRate, es funktioniert.

Mein controller ist wie diese

<?php

namespace app\controllers;

use Yii;
use app\models\Techs;
use app\models\Ticket;
use app\models\Assignment;
use app\models\TicketSearch;
use app\models\ComplainType;
use app\models\TicketComplain;
use app\models\User;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use app\models\Adusers;
use yii\web\UploadedFile;
use app\helpers\Utils;
use yii\db\Expression;
use yii\filters\AccessControl;


/**
 * TicketController implements the CRUD actions for Ticket model.
 */
class TicketController extends Controller {
    public function behaviors() {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'only'  => [
                    'index', 
                    'view',
                    'update',
                    'delete', 
                    'newticket'
                ],
                'rules' => [
                    [
                        'actions' => [
                            'index',
                            'view', 
                            'update',
                            'delete', 
                            'newticket'
                        ],
                        'allow'   => true,
                        'roles'   => ['@'],
                    ],
                ],
            ],
            'verbs'  => [
                'class'   => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    public function actionRateTicket($id) {
        echo "in"; echo $id;
        exit;
    }
}
?>

Meine .htaccess-web-Ordner ist

RewriteEngine on

# 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
InformationsquelleAutor user7282 | 2015-05-11
Schreibe einen Kommentar