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

"class" function override default class #62

Closed
gpassarelli opened this issue Jan 30, 2013 · 1 comment
Closed

"class" function override default class #62

gpassarelli opened this issue Jan 30, 2013 · 1 comment

Comments

@gpassarelli
Copy link

In Laravel 3, when you are defining a field and you use the "class" function, the field comes just with the new classes instead of come also with the size classes.
For example, if you have the following code:

{{Former::mini_text('currency')->prepend('$')->required()->class('currency')}}

Instead of render the code:

<div class="control-group required">
  <label for="currency" class="control-label">Currency<sup>*</sup></label>
  <div class="controls">
    <div class="input-prepend">
      <span class="add-on">$</span>
      <input class="input-mini currency" required="true" type="text" name="currency" id="currency">
    </div>
  </div>
</div>

It renders the code:

<div class="control-group required">
  <label for="currency" class="control-label">Currency<sup>*</sup></label>
  <div class="controls">
    <div class="input-prepend">
      <span class="add-on">$</span>
      <input class="currency" required="true" type="text" name="currency" id="currency">
    </div>
  </div>
</div>

This was you keep the consistence of the code, declaring all the sizes with the field declaration instead of put the size as a class for the fields that you want to have an extra class

@Anahkiasen
Copy link
Member

That's normal, class sets the class. You should use addClass for what you're trying to do.

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

No branches or pull requests

2 participants