Having issues extending CUrlManager

Hey Everyone,

 So I'm trying to create my own class that extends CUrlManager so I can take a url like /something/else/23342 and based on that / the host name, parse that url into something like index.php?r=controler/action . This is working fine actually, the only problem is that if I append &somevar=something to what parseUrl($request) returns, I get a 404 error "The system is unable to find the requested action "view&id=1"." 

So it seems like adding any extra parameters to pass to the action cuts off the controller portion of what the function returns. Can anyone provide some insight into what I’m doing wrong? I’m very new to Yii so hopefully this isn’t a stupid question.




class PUrlManager extends CUrlManager {

    public function parseUrl($request) {

		$rawPathInfo=$request->getPathInfo();

        print('<pre>');

        var_dump($_SERVER["HTTP_HOST"]);

        print('</pre>');


        print('<pre>');

        var_dump($rawPathInfo);

        print('</pre>');


        if(isset($_GET[$this->routeVar])) {

            if($_GET[$this->routeVar] == 'site/login') {

                return 'site/login';

            }

        }


        else

            return "project/view&id=1";

    }

}



Are you sure you could not get the same result with the url manager that comes with Yii? It’s very powerful and takes you a long way before you find a situation where you really have to extend CUrlManager. See here:

http://www.yiiframework.com/doc/guide/1.1/en/topics.url