0
URLからコントローラーとアクション名を隠して、スラッグだけが表示されます。http://localhost/test-project/frontend/web/test-conditionと "test-condition"はslugです。私のconfig/mainのurlManagerからこれを管理します。 PHPurlからコントローラーとアクションを削除する
URLからコントローラーとアクション名を隠して、スラッグだけが表示されます。http://localhost/test-project/frontend/web/test-conditionと "test-condition"はslugです。私のconfig/mainのurlManagerからこれを管理します。 PHPurlからコントローラーとアクションを削除する
'urlManager' => [
'class' => 'yii\web\UrlManager',
// Disable index.php
'showScriptName' => false,
// Disable r= routes
'enablePrettyUrl' => true,
'rules' => array(
....
'<slug:[a-zA-Z0-9_ -]+>-consult' => 'CONTROLLER NAME/ACTION',
),
],
次回は、コードとともに短い説明を入力してください。ありがとう – Kerberos