Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap : display label in inline form #116

Open
yii-bot opened this issue Jan 24, 2016 · 3 comments
Open

Bootstrap : display label in inline form #116

yii-bot opened this issue Jan 24, 2016 · 3 comments
Labels
type:enhancement Enhancement

Comments

@yii-bot
Copy link

yii-bot commented Jan 24, 2016

This issue has originally been reported by @klevron at yiisoft/yii2#10103.
Moved here by @cebe.


Actually if I want to display a label in an inline form, I have to do this :

<?php $form = ActiveForm::begin(['layout' => 'inline']); ?>
    <?= $form->field($model, 'field')->label(null,  ['class' => '']) ?>
<?php ActiveForm::end(); ?>

https://github.com/yiisoft/yii2-bootstrap/blob/2.0.5/ActiveField.php#L379

There should be a proper way to do this (same for enableError), no ?

@cebe
Copy link
Member

cebe commented Jan 24, 2016

To enable this for all labels I use it this way:

    <?php $form = ActiveForm::begin([
        'layout' => 'inline',
        'fieldConfig' => [
            'labelOptions' => ['class' => ''],
            'enableError' => true,
        ]
    ]); ?>

could be added as an option though.

@cebe cebe added the type:enhancement Enhancement label Jan 24, 2016
@bologer
Copy link

bologer commented Jun 13, 2017

@cebe Is that implemented? If not, is there any existing solution to do that?

@cebe
Copy link
Member

cebe commented Jun 13, 2017

@bologer what exactly? there is no option to enable it yet, you have to use the code I gave above for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants