Rules Url And Chtml

I have a problem

  • I have a action in SiteController

    [b] public function actionHello($test)

     {
    
    
         echo $test;
    
    
     } [/b]
    
  • Rules in urlManager

    [b] 'rules'=>array(
    
    
         'post/<test>'=>'site/hello',
    

    ),[/b]

    get url: localhost/project/post/abc => It works

  • But, When i use CHtml in SiteController => actionIndex()

      [b]echo CHtml::link('Links',array('post','test'=>'abc'));[/b]
    
    
          //output: localhost/project/site/post/test/abc  => error
    
    
    
    
    
      [b]echo CHtml::link('Links',array('[b]/post[/b]','test'=>'abc'));[/b]
    
    
          //output: localhost/project/post/test/abc  => error
    

    I want to get output by Chtml: localhost/project/post/abc, How?

    Thanks!

You should pass the route:




CHtml::link('Links', array('site/hello', 'test'=>'abc'));



Thank you ;D