Code Monkey home page Code Monkey logo

Comments (9)

simialbi avatar simialbi commented on August 24, 2024

How does the rendered content look like (html)?

from yii2-bootstrap5.

numitec avatar numitec commented on August 24, 2024

The code view:

<div class="col-md-6">
	<?= $form->field($model, 'active')->checkBox( ['switch' => True] ) ?>
</div>

is rendered like this:

<div class="form-group field-user-active">
<input type="hidden" name="User[active]" value="0"><label><input type="checkbox" id="user-active" name="User[active]" value="1" switch> Active</label>
<div class="help-block"></div>
</div>

from yii2-bootstrap5.

simialbi avatar simialbi commented on August 24, 2024

Do you override the default template of the active-fields, e.g in active-form?

from yii2-bootstrap5.

numitec avatar numitec commented on August 24, 2024

No: nothing at all.

I've only issued: /usr/local/bin/composer create-project --prefer-dist yiisoft/yii2-app-advanced testapp, and it came to pass that BS5 was installed.

BTW: I've tested:

yii\bootstrap5\Progress::widget( ['percent' => 50, 'label' => '50%', 'class' => 'pogress-bar'] );

and it runs flawlessly.

from yii2-bootstrap5.

WinterSilence avatar WinterSilence commented on August 24, 2024

@numitec can you display more sources? maybe you change template or something like this?

from yii2-bootstrap5.

numitec avatar numitec commented on August 24, 2024

@WinterSilence I resolved using SwitchInput from kartik library:

use kartik\switchinput\SwitchInput;
...

<?= $form->field($model, 'active')->widget( SwitchInput::classname(), [] ); ?>

from yii2-bootstrap5.

WinterSilence avatar WinterSilence commented on August 24, 2024

@numitec sorry but its look like fake - your example in unit test

from yii2-bootstrap5.

numitec avatar numitec commented on August 24, 2024

@WinterSilence, I didn't quite follow you. Could you elaborate it?

from yii2-bootstrap5.

WinterSilence avatar WinterSilence commented on August 24, 2024

@numitec https://github.com/yiisoft/yii2-bootstrap5/blob/master/tests/ActiveFieldTest.php#L173

from yii2-bootstrap5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.