CBaseUrlRule not included


I can’t find CBaseUrlRule.php in the file, please add it.

Again… check the documentation for CBaseUrlRule -

Under the "source code" is the path to the file where this class is located…

spoiler: some of the Yii clases are not in a separate file but are grouped together in an another component file.

i’m trying to install an extension (urlrouter), i placed it under components.

The class starts by:

class UrlRouter extends CBaseUrlRule {


But Yii says :

Why do you need to extend that class… note that this is an abstract class -

I don’t made the “urlrouter” extension, i’m just trying to include it.

This is because Yii does not know that CBaseUrlRule does not have an own file.

Try this:


class UrlRouter extends CBaseUrlRule {


I added it to the "import" array :

    'import' => array(





same error:

sorry, second parameter of import has to be true to force include:

Yii::import('system.web.CUrlManager', true);

class UrlRouter extends CBaseUrlRule {


This is not possible with import configuration, you have to do it in the file where you declare your class.

Ok, fine, but this extension has too many errors, i think i’ll leave it.

I get errors like :


It looks like you try to use CBaseUrl/CUrlRule rule as a CUrlManager? That won’t work.

What do you want to do? Replace the CUrlManager OR have a custom url rule as explained here?

For the first you simply extend from CUrlManager and not from CBaseUrlRule/CUrlRule.

For the latter you should extend from CUrlRule and not from CBaseUrlRule.

is it a fake extension ? (only 1 file, take a look) :

The extension name is a little missleading since it’s named “urlrouter” which implies it’s an UrlManager replacement, but it’s just an UrlRule. So according to your comments on the extension page, you have a wrong config.

It should be like this:

'urlManager' => array(

   'rules' => array(



         'class' => 'application.components.UrlRouter',




I’ve downloaded, it looks ok to me.

ah OK !

Thanks for the check !

@Y!! :

Today i tried the config but the urlrouter class does not take effect, here is my config:

        'urlManager' => array(

            'urlFormat' => 'path',

            'showScriptName' => false,

            'rules' => array(

                'class' => 'application.components.UrlRouter'



I also tried:










It gives the same result as:

        'urlManager' => array(

            'urlFormat' => 'path',

            'showScriptName' => false,

            'rules' => array(




Please make a try

I don’t use this extension. I can only point you to the description that says:

If you can’t get it to work, you may ask the author directly via private message.

Finally i reviewed a wiki that helped me to know more things about default Yii rules:





In the 3rd line, instead of <custom_title> i lost a lot of time because i tried to do it with reg expressions like :


And Yii had created urls like :


then i tried to switch to that useless extension :lol:

So how did you solve it?

I wanted to remove the ‘default’ controller when accessing a module.

for example:

from: route/module/default/actionID

to: route/module/actionID

Can anyone solve this?

What did you expect instead? Looks okay for me… And why do you try that extension for things you could achive with yii itself?


Is this what you want?