title: HTML Button calling controller/action
body: <p>I am trying to create html button in Yii on button click I want to call a UserController.php and Actioncreate .</p>
  
  <p>I am doing like this ,</p>
  
  <pre><code> echo CHtml::button('Signup', array('button' =&gt; array('Users/create'))); ?&gt;
  </code></pre>
  
  <p>But it's giving me following error </p>
  
  <pre><code>htmlspecialchars() expects parameter 1 to be string, array given 
  </code></pre>
  
  <p>This is stack trace </p>
  
  <pre><code>D:\wamp\www\yii\framework\web\helpers\CHtml.php(85)
  
  73      */
  74     public static $liveEvents = true;
  75 
  76     /**
  77      * Encodes special characters into HTML entities.
  78      * The {@link CApplication::charset application charset} will be used for encoding.
  79      * @param string $text data to be encoded
  80      * @return string the encoded data
  81      * @see http://www.php.net/manual/en/function.htmlspecialchars.php
  82      */
  83     public static function encode($text)
  84     {
  85         return htmlspecialchars($text,ENT_QUOTES,Yii::app()-&gt;charset);
  86     }
  87 
  88     /**
  89      * Decodes special HTML entities back to the corresponding characters.
  90      * This is the opposite of {@link encode()}.
  91      * @param string $text data to be decoded
  92      * @return string the decoded data
  93      * @see http://www.php.net/manual/en/function.htmlspecialchars-decode.php
  94      * @since 1.1.8
  95      */
  96     public static function decode($text)
  97     {
  
  Stack Trace
  #0  
  +
   D:\wamp\www\yii\framework\web\helpers\CHtml.php(85): htmlspecialchars(array("Users/create"), 3, "UTF-8")
  #1  
  +
   D:\wamp\www\yii\framework\web\helpers\CHtml.php(2216): CHtml::encode(array("Users/create"))
  #2  
  +
   D:\wamp\www\yii\framework\web\helpers\CHtml.php(140): CHtml::renderAttributes(array("button" =&gt; array("Users/create"), "name" =&gt; "yt1", "type" =&gt; "button", "value" =&gt; "Signup"))
  #3  
  +
   D:\wamp\www\yii\framework\web\helpers\CHtml.php(436): CHtml::tag("input", array("button" =&gt; array("Users/create"), "name" =&gt; "yt1", "type" =&gt; "button", "value" =&gt; "Signup"))
  #4  
  –
   D:\wamp\www\nurseweb\protected\views\site\login.php(50): CHtml::button("Signup", array("button" =&gt; array("Users/create")))
  
  45         &lt;?php echo $form-&gt;error($model,'rememberMe'); ?&gt;
  46     &lt;/div&gt;
  47 
  48     &lt;div class="row buttons"&gt;
  49         &lt;?php echo CHtml::submitButton('Login');  
  50  echo CHtml::button('Signup', array('button' =&gt; array('Users/create'))); ?&gt;
  51 &lt;?php $this-&gt;endWidget(); ?&gt;
  52 &lt;/div&gt;&lt;!-- form --&gt;
  
  #5  
  +
   D:\wamp\www\yii\framework\web\CBaseController.php(127): require("D:\wamp\www\nurseweb\protected\views\site\login.php")
  #6  
  +
   D:\wamp\www\yii\framework\web\CBaseController.php(96): CBaseController-&gt;renderInternal("D:\wamp\www\nurseweb\protected\views\site\login.php", array("model" =&gt; LoginForm), true)
  #7  
  +
   D:\wamp\www\yii\framework\web\CController.php(870): CBaseController-&gt;renderFile("D:\wamp\www\nurseweb\protected\views\site\login.php", array("model" =&gt; LoginForm), true)
  #8  
  +
   D:\wamp\www\yii\framework\web\CController.php(783): CController-&gt;renderPartial("login", array("model" =&gt; LoginForm), true)
  #9  
  –
   D:\wamp\www\nurseweb\protected\controllers\SiteController.php(98): CController-&gt;render("login", array("model" =&gt; LoginForm))
  
  093             // validate user input and redirect to the previous page if valid
  094             if($model-&gt;validate() &amp;&amp; $model-&gt;login())
  095                 $this-&gt;redirect(Yii::app()-&gt;user-&gt;returnUrl);
  096         }
  097         // display the login form
  098         $this-&gt;render('login',array('model'=&gt;$model));
  099     }
  100 
  101     /**
  102      * Logs out the current user and redirect to homepage.
  103      */
  
  #10     
  +
   D:\wamp\www\yii\framework\web\actions\CInlineAction.php(50): SiteController-&gt;actionLogin()
  #11     
  +
   D:\wamp\www\yii\framework\web\CController.php(309): CInlineAction-&gt;runWithParams(array("r" =&gt; "site/login"))
  #12     
  +
   D:\wamp\www\yii\framework\web\CController.php(287): CController-&gt;runAction(CInlineAction)
  #13     
  +
   D:\wamp\www\yii\framework\web\CController.php(266): CController-&gt;runActionWithFilters(CInlineAction, array())
  #14     
  +
   D:\wamp\www\yii\framework\web\CWebApplication.php(283): CController-&gt;run("login")
  #15     
  +
   D:\wamp\www\yii\framework\web\CWebApplication.php(142): CWebApplication-&gt;runController("site/login")
  #16     
  +
   D:\wamp\www\yii\framework\base\CApplication.php(162): CWebApplication-&gt;processRequest()
  #17     
  –
   D:\wamp\www\nurseweb\index.php(13): CApplication-&gt;run()
  
  08 defined('YII_DEBUG') or define('YII_DEBUG',true);
  09 // specify how many levels of call stack should be shown in each log message
  10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
  11 
  12 require_once($yii);
  13 Yii::createWebApplication($config)-&gt;run();
  </code></pre>
  
  <p>Can anyone tell me what the meaning of this error is and also guided me for the solution?</p>