Skip to content

Adding form decorators #1

Closed
wants to merge 3 commits into from

2 participants

@adepretis

Hi,

I modified Twitter_Bootstrap_Form_Vertical to do it's magic in init() not __construct() so that additional form decorators can be added by specific forms. For example the 'ViewScript' decorator.

class My_Form extends Twitter_Bootstrap_Form_Horizontal
{
    public function init()
    {
        $this->addDecorator(
            'ViewScript',
            array('viewScript' => 'forms/myviewscript.phtml')
        );
    }
}

$this->init() is called by Zend_Form::__construct() so everything is fine.

I recognized to late that you used spaces instead of tabs for indenting - my commit included tabs. If this is a problem, please just revert it back to whitespaces or I can do another pull request.

Furthermore I added a .gitignore with '.DS_Store' ... forgot to create a branch before commiting the above changes :-(

@theUniC
theUniC commented Mar 19, 2012

Hi,

Thanks for your PR! I think it can be done in another way that implementing the Zend_Form::init method. I'll comment it in the file itself.

On the other side, we're using spaces instead of tabs because we're following the Zend Framework coding standards, so the PR must be compatible with it.

Regards,
Christian.

@adepretis adepretis closed this Mar 19, 2012
@adepretis

Ok, sounds reasonable.

@theUniC
theUniC commented Mar 19, 2012

Make the changes and PR again, to merge the new behaviour! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.