Friday, March 22, 2013

How to override an attribute name in yii model ?

In model add an override function for checking the errors generated on validation.

public function getErrors($attribute=null)
        $errors = parent::getErrors($attribute);
        if ($attribute == null) {
            // Ok We get a collection of errors
            if (isset($errors['attribute_to_be_replaces'])) {
                $error = $errors['attribute_to_be_replaces'];
                $errors['replaced_attribute_name'] = $error;
        return $errors;

Thursday, February 28, 2013

Delete a remote tag

First delete it from local
git tag -d tag_name

Then push the change to remote
git push origin :refs/tags/tag_name