Incorrect Output For Createurl

Hi there!

I am experimenting with Yii’s ability to print URL patterns from urlManager, and am frustrated to find output that differs from what I would expect.

Here are the URL patterns I am using from page 41:


'urlManager' => array(

  'urlFormat' => 'path',

  'rules' => array(

    '<alias:about>' => 'website/page',

    'page/about/<alias:authors>' => 'website/page',

    'page/<alias>' => 'website/page',

  ),

Here is my call to createUrl:


echo $this->createUrl('website/page', array('alias' => 'authors'));

And here is the output:

/authors

Given that alias is set to "authors", and not "about", I would expect it to print "/page/about/authors". Is this incorrect?

By default when creating URLs Yii takes parameter name into account but ignores regex. Because of that the first rule matches and is used.