Skip to content

Commit

Permalink
updateded / fixed url rules for nice urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Stebe committed Jun 18, 2015
1 parent 363b049 commit 483ff55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Bootstrap.php
Expand Up @@ -43,13 +43,9 @@ public function bootstrap($app)
if (getenv('APP_PRETTY_URLS')) {
$app->urlManager->addRules(
[
// pages default page route
// pages default page route
'<parentLeave:[a-zA-Z0-9_\-\.]*>/<pageName:[a-zA-Z0-9_\-\.]*>-<id:[0-9]*>.html' => 'pages/default/page',
'<pageName:[a-zA-Z0-9_\-\.]*>-<id:[0-9]*>.html' => 'pages/default/page',

// site/index page route
'<parentLeave:[a-zA-Z0-9_\-\.]*>/<pageName:[a-zA-Z0-9_\-\.]*>-<id:[0-9]*>.html' => 'site/index',
'<pageName:[a-zA-Z0-9_\-\.]*>-<id:[0-9]*>.html' => 'site/index',
'<pageName:[a-zA-Z0-9_\-\.]*>-<id:[0-9]*>.html' => 'pages/default/page',
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/DefaultController.php
Expand Up @@ -69,7 +69,7 @@ public function actionIndex()
return $this->render('index');
}

public function actionPage($id)
public function actionPage($id, $pageName = null, $parentLeave = null)
{
Url::remember();
\Yii::$app->session['__crudReturnUrl'] = null;
Expand Down

0 comments on commit 483ff55

Please sign in to comment.