Yii Framework Forum: Is It Possible To Design A Custom Layout For Forms (Yii-Bootstrap3-Module)? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Is It Possible To Design A Custom Layout For Forms (Yii-Bootstrap3-Module)? Rate Topic: ****- 1 Votes

#1 User is offline   Jenson Paul 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 31-May 14

Posted 01 June 2014 - 12:09 AM

Hi All,
Is It Possible To Design A Custom Layout For Forms using Yii-Bootstrap3-Module extension?
<?php
$form = $this->beginWidget('bootstrap.widgets.BsActiveForm', array(
    'layout' => BsHtml::FORM_LAYOUT_HORIZONTAL,
    'enableAjaxValidation' => true,
    'id' => 'article-form',
    'htmlOptions' => array(
        'class' => 'article-form',
    )
));
?>

The above code creates the following form with specified grids.
<div class="form-group">
  <label class="control-label col-lg-2 required" for="Post_title">Title <span class="required">*</span></label>
  <div class="col-lg-10">
    <input class="form-control" name="Post[title]" id="Post_title" placeholder="Title" type="text" />
    <p id="Post_title_em_" style="display:none" class="help-block"></p>
  </div>
</div>

I have seen that this has been achieved by adding specific static class names to the Horizontal Layout in the source code. I want to adjust this label grid class or at least the input div grid from col-lg-10 to col-lg-6. Is there any simple way to achieve this without editing the extension source code or by using a custom layout like FORM_LAYOUT_CUSTOM and minimal changes?
Any help is appreciated. Thank You.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users