Declaration of BActiveForm::labelEx() should be compatible with that of CActiveForm::labelEx() #7

lgndacia opened this Issue Jul 9, 2012 · 4 comments


None yet
3 participants

lgndacia commented Jul 9, 2012

  1. Do not tell me about this php bug That bug has nothing to do with your poorly written code.
  2. On every development server use error_reporting = -1
  3. Always use error_reporting = -1 on dev. servers(maybe you missed first time)
  4. Let's see the actual bugs:
    • "Declaration of BActiveForm::labelEx() should be compatible with that of CActiveForm::labelEx()"
      • your method:public function labelEx(CModel $model, $attribute, $htmlOptions=array())
      • yii method : public function labelEx($model,$attribute,$htmlOptions=array())
      • Why the type hinting in your method?
      • Remove the CModel from your method and bam, the error just disappear.
    • "Declaration of BActiveForm::checkBox() should be compatible with that of CActiveForm::checkBox()"
      • your method:public function checkBox(CModel $model, $attribute, $htmlOptions=array())
      • yii method : public function checkBox($model,$attribute,$htmlOptions=array())
      • same shit as previous one, just remove the CModel from your method
    • "Declaration of BHtml::linkButton() should be compatible with that of CHtml::linkButton()"
      • your method:public static function linkButton($label, $url = '#', $htmlOptions = array())
      • yii method : public static function linkButton($label='submit',$htmlOptions=array())
      • seriously why? If you need that $url parameter just pass it through $htmlOptions array
      • remove the $url parameter from declaration and from return(return self::link($label, $url, $htmlOptions); --> return self::link($label, $htmlOptions); ).
  5. Only these three I have found, but most likely there are other. So error_reporting -1 and check again.

Sorry for my poor English, but is not my first language.


tetele commented Jul 9, 2012

Does poor English excuse bad manners?

Is this ^^^ going to be fixed soon? I just installed it and have the same issues.


tetele commented Sep 26, 2012

This project has been left aside due to lack of interest and other (updated) options. But I'll gladly take pull requests if anyone wants to fix the bug.

I think lgndacia should post his fix if he has one. I think i did what he said and it didn't work for me. I would gladly do it however, i don't know enough about yii yet. I just started working with it yesterday.

tetele closed this in e51993e Mar 18, 2013

@tetele tetele added a commit that referenced this issue Mar 18, 2013

@tetele tetele Merge pull request #8 from eg/master
Fix for #7 issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment