Note that there are some explanatory texts on larger screens.

plurals
  1. POYii Framework form submit button showing error
    primarykey
    data
    text
    <p>I am getting an error<br/><code>Fatal error: Call to a member function hasErrors() on a non-object in F:\xampp\yii\framework\web\helpers\CHtml.php on line 2253</code> <br/>when trying to access the url <code>http://localhost/happybox/index.php/site/cart/3</code>. The code of my view file cart.php is: </p> <pre><code>Hello, &lt;?php echo ucwords(Yii::app()-&gt;user-&gt;name); ?&gt;,&lt;br/&gt; This is your cart&lt;br/&gt; Click on Order to Place and Order.&lt;br/&gt; &lt;?php $Orders = Orders::model()-&gt;findAll(array( 'select'=&gt;'products_id', 'condition'=&gt;'users_id=:id &amp;&amp; type=:type', 'params'=&gt;array(':id'=&gt;Yii::app()-&gt;user-&gt;id, ':type'=&gt;'cart'), )); ?&gt; &lt;?php if($Orders){ foreach ($Orders as $order) { echo '&lt;br/&gt;'.$order-&gt;products-&gt;title.'&lt;br/&gt;'.$order-&gt;products-&gt;description.'&lt;br/&gt;'; } }else{ echo 'Your Cart is Empty'; } ?&gt;&lt;br/&gt;&lt;br/&gt; &lt;?php if($Orders){ $form=$this-&gt;beginWidget('CActiveForm', array('id'=&gt;'order-form')); echo $form-&gt;hiddenField($model,'users_id',array('value'=&gt;Yii::app()-&gt;user-&gt;id)); echo CHtml::submitButton('Confirm Your Order'); $this-&gt;endWidget(); } ?&gt; </code></pre> <p>The code of my controller function is <br/></p> <pre><code>public function actionCart($id){ if(Yii::app()-&gt;user-&gt;isGuest){ $this-&gt;redirect('login'); }else{ $model=$this-&gt;loadModel($id); if(isset($_POST['Orders'])) { //do something } $this-&gt;render('cart', array('model'=&gt;$model)); } } </code></pre> <p>Can someone please point out the error in this code, Its very very important for me. Please help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload