Should Yii 2 applications switch to bootstrap 4 for new projects?

  • Yes, switch to Bootstrap 4
  • No, keep Bootstrap 3

0 voters


Please provide arguments about not switching. Thanks!

I think, why it must be depends on bootstrap , some one need to use another html frameworks like bulma and …

@mamad_za there are only two options in the poll :wink:

The concern you are talking about is there in Yii 3.0. Application template, by default, doesn’t depend on any framework there. In 2.0 we are going to leave the fact of dependency on bootstrap as is.

I think first of all users choose bootstrap for its grid.
Bootstrap 4 use latest native css features for a grid flexibility. And added some new additional margin, padding and align classes.

1 Like

What about releasing an intermediate “2.5” version between 2.0 and 3.0, not backward compatible with 2.0 and upgraded with enhanced dependencies? I’m thinking, for example:

  • PHP 7.1+
  • Bootstrap 4.0
  • PHPUnit 7.1
  • Codeception Specify & Verify 1.0
  • SwiftMailer 2.1.0
  • Newer versions of yii2-gii, yii2-apidoc, yii2-shell, yii2-debug… which should be released too (there’re some interesting commits & PRs here and there waiting to be included in a new release of these packages).

It could be a great step forward whilst waiting for a 3.0 release.

Aside from that, I obviously voted YES for switching to Bootstrap 4.0 in Yii 2, of course.

1 Like

PHP 7.1+

Yii 2.0 works with it well.

Bootstrap 4.0

We’ll release Bootstrap 4 extension before next 2.0 release and you’ll be able to use it with 2.0. We may make it default for applications… or not.

PHPUnit 7.1
Codeception Specify & Verify 1.0
SwiftMailer 2.1.0
Newer versions of yii2-gii , yii2-apidoc , yii2-shell , yii2-debug

You can use it in your applications with 2.0 right now.

The poll question is unclear.
Does answering YES mean that backward compatability will be broken for current existing projects?
(e.g. when updating Yii 2.0.13 -> 2.0.16)
As for the new projects backwards compatability does not matter and therefore it should go with BS4.

1 Like

No since application templates are used for starting new applications only and are never updated.


I think, it is not bad idea, but for preventing conflicts, it should change minor version.

Yii3 - absolutely new
Yii2.1.x - with bootstrap4
Yii2.0.x - as is

Probably it will be harder for support, but more clear for use

But template still is sicked to PHP 5.4 and using outdated approaches (like deprecated className() method instead of ::class) without any valid reason. IMO project starter should always use cutting edge technologies and promote modern approach - template is used only for new projects, so there is no need to keep support for old software.

And unless we want to support both, BS3 and BS4 versions, I don’t see much sense in releasing it as 2.1 - it is just confusing, since so far template releases were sicked to core release, so it will look like template for Yii 2.1.

@Insolita marking it 2.1 doesn’t worth the trouble and will drift us away from 3.0. Either it is a minor release or we’re not updating it.

1 Like

Agreeing with @rob006, having the template ship with className() instead of ::class is kind of weird, especially if we consider that even PHP 5.6 reached its EOL in the beginning of the year:

I’d do the following:

  • Keep PHP 5.4 compatibility for Yii 2, no need to brake it with our last 2.0.X release
  • Release 2.0.16 + yii2-bootstrap4, and enter the fix-only mode
  • Release templates revisited for at least the 5.6 syntax & bootstrap4. State that change in the README, and point users to the v2.0.14 of the template if they want the old behavior.
  • Focus on 3.x :clap:
  • Browser support
  • Existing applications / widgets that include yii/bootstrap/BootstrapAsset should all be updated incase of this update, (we use Yii2 as a shared package, any application that uses BS3 can’t use the newly updated widget with bs4, which results in an outdated application? Or can we have BS3 and bs4 in a single application?)

You are raising a solid and valid point @njitram. Updating the template to bootstrap4 would probably turn into a nightmare in regards of extensions compatibility.

The upgrade itself isn’t that complicated for folks who will want to upgrade to bootstrap4. Maybe we should keep bootstrap3 for Yii 2 after all.

1 Like

Yes, indeed it sounds trouble and upgrading manually isn’t that bad. Let’s release without upgrading the app.


I think switching to Bootstrap 4 will give lots of problems for Yiisoft and other developers. Do you really need to evolve Yii2 when Yii3 is much more expected and meeting the requirements of time?

1 Like

Depends also, if you wanna use existing extensions, eg. usuario, settings, translatemanager, … - I haven’t checked how compatible they are with BS4.

1 Like

From my point of view, each and every implementation has its idiosyncrasies and live exerience of dealing with multiple projects and situations is called developer experience. This experience can be monetized because we can deliver a working solution fast and accurate based on this knowledge.

So, I conside Yii2 my development platform of first choice. If you switch to BS4 a lot of my experience will be cancelled for very narrow improvement. Really - I would like to keep Yii3/BS4 as a separate challenge and keep Yii2/BS3 intact.


Makes sense. Decided to keep it as is for Yii 2.0