title: yii2 check errors to show error div
body: <p>i am showing this div when errors exist!</p>
  
  <p>I what to write if condition to check wether error are there or not.</p>
  
  <pre><code>&lt;?php if(error){ // here?&gt;
      &lt;div class="alert alert-warning"&gt;
      &lt;?= $form-&gt;errorSummary($model); ?&gt;
      &lt;/div&gt;     
  &lt;?php } ?&gt;
  </code></pre>