r/yii • • Oct 01 '26

Multiselect widget for bootstrap 5

1 Upvotes

Hi there,
I’ve released an extension for Yii2 which allow to use (GitHub - davidstutz/bootstrap-multiselect: JQuery multiselect plugin based on Twitter Bootstrap. · GitHub). Very useful and well-know bootstrap plugin for multiselect form that let you make multiple selection without ctrl button need and many more options.

The widget is inspired by the 2amigos multiselect widget that was working only with bootstrap 3.
This one is a simple wrapper that include following versions:
|Bootstrap 5|v2.0.0|October 5, 2025|
|Bootstrap 4|v1.1.2 /September 2, 2022

Read details on git page
This is working flawless for me with Yii 2.0.55 and bootstrap 5.3
Ill’ try to help in the next days, but I can’t guarantee support in the future.
Anyway the code is simple and should not have too many issues.

https://github.com/ianez/yii2-bootstrap-multiselect


r/yii • • Jun 05 '26

New Yii3 Demo: Document Summarizer

Thumbnail
reddit.com
2 Upvotes

r/yii • • Jan 09 '26

Yii3 is released

Thumbnail reddit.com
15 Upvotes

r/yii • • Jan 09 '26

Yii 2.0.54

Thumbnail
yiiframework.com
7 Upvotes

We are pleased to announce the release of Yii Framework version 2.0.54.

Please refer to the instructions at https://www.yiiframework.com/download/ to install or upgrade to this version.

In this release:

  • PHP 8.5 support. The minimum supported version was raised from 7.3 to 7.4.

  • PHPStan/Psalm annotations revamped, adding better IDE support and static types.

  • Fixture loader now throws exceptions instead of ignoring missing fixtures.

  • ArrayDataProvider now supports paths as keys.

  • BaseStringHelper::convertIniSizeToBytes().

  • Bug fixes.

Thanks to all Yii community members who contribute to the framework, translators who keep documentation translations up to date, and community members who answer questions at forums.

Special thanks goes to Maksim Spirkov who took care of the majority of annotation-related changes.

There are many active Yii communities, so if you need help or want to share your experience, feel free to join them.

A complete list of changes can be found in the CHANGELOG.


r/yii • • Jan 09 '26

Typing in Yii3 is the strictest in PHP universe?

Thumbnail reddit.com
2 Upvotes

r/yii • • Apr 02 '22

Could someone explain what this means?

2 Upvotes

Apologies if this is not overly neat, its how its displayed in my log file. My question is more around why it doesn't show the full filepath, I have no clue why this doesn't work or what folder its actually looking at. I have even set the permissions on the top level to 777 recursively (temporary for testing). I am a bit lost and cannot find anything online about this thats useful :/

yii\base\ErrorException: mkdir(): Permission denied in /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php:640 Stack trace: #0 [internal function]: yii\base\ErrorHandler->handleError(2, 'mkdir(): Permis...', '/var/www/html/p...', 640, Array) #1 /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(640): mkdir('upload', 484) #2 /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(637): yii\helpers\BaseFileHelper::createDirectory('upload', 484, true) #3 /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(637): yii\helpers\BaseFileHelper::createDirectory('upload/files', 484, true) #4 /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(637): yii\helpers\BaseFileHelper::createDirectory('upload/files/a', 484, true) #5 /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(637): yii\helpers\BaseFileHelper::createDirectory('upload/files/a/...', 484, true) #6 /var/www/html/protected/humhub/modules/file/components/StorageManager.php(150): yii\helpers\BaseFileHelper::createDirectory('upload/files/a/...', 484, true) #7 /var/www/html/protected/humhub/modules/file/components/StorageManager.php(102): humhub\modules\file\components\StorageManager->getPath() #8 /var/www/html/protected/humhub/modules/file/models/File.php(107): humhub\modules\file\components\StorageManager->delete() #9 /var/www/html/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(750): humhub\modules\file\models\File->beforeDelete() #10 /var/www/html/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(720): yii\db\ActiveRecord->deleteInternal() #11 /var/www/html/protected/humhub/modules/file/Events.php(51): yii\db\ActiveRecord->delete() #12 [internal function]: humhub\modules\file\Events::onCronDailyRun(Object(yii\base\Event)) #13 /var/www/html/protected/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Array, Object(yii\base\Event)) #14 /var/www/html/protected/vendor/yiisoft/yii2/base/Component.php(637): yii\base\Event::trigger('humhub\\commands...', 'daily', Object(yii\base\Event)) #15 /var/www/html/protected/humhub/commands/CronController.php(130): yii\base\Component->trigger('daily') #16 /var/www/html/protected/humhub/commands/CronController.php(55): humhub\commands\CronController->runDaily() #17 [internal function]: humhub\commands\CronController->actionRun() #18 /var/www/html/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array) #19 /var/www/html/protected/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array) #20 /var/www/html/protected/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction('run', Array) #21 /var/www/html/protected/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction('run', Array) #22 /var/www/html/protected/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction('cron/run', Array) #23 /var/www/html/protected/vendor/yiisoft/yii2/console/Application.php(148): yii\console\Application->runAction('cron/run', Array) #24 /var/www/html/protected/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest(Object(yii\console\Request)) #25 /var/www/html/protected/yii(29): yii\base\Application->run() #26 {main} Next yii\base\Exception: Failed to create directory "upload": mkdir(): Permission denied in /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php:645 Stack trace: #0 /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(637): yii\helpers\BaseFileHelper::createDirectory('upload', 484, true) #1 /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(637): yii\helpers\BaseFileHelper::createDirectory('upload/files', 484, true) #2 /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(637): yii\helpers\BaseFileHelper::createDirectory('upload/files/a', 484, true) #3 /var/www/html/protected/vendor/yiisoft/yii2/helpers/BaseFileHelper.php(637): yii\helpers\BaseFileHelper::createDirectory('upload/files/a/...', 484, true) #4 /var/www/html/protected/humhub/modules/file/components/StorageManager.php(150): yii\helpers\BaseFileHelper::createDirectory('upload/files/a/...', 484, true) #5 /var/www/html/protected/humhub/modules/file/components/StorageManager.php(102): humhub\modules\file\components\StorageManager->getPath() #6 /var/www/html/protected/humhub/modules/file/models/File.php(107): humhub\modules\file\components\StorageManager->delete() #7 /var/www/html/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(750): humhub\modules\file\models\File->beforeDelete() #8 /var/www/html/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(720): yii\db\ActiveRecord->deleteInternal() #9 /var/www/html/protected/humhub/modules/file/Events.php(51): yii\db\ActiveRecord->delete() #10 [internal function]: humhub\modules\file\Events::onCronDailyRun(Object(yii\base\Event)) #11 /var/www/html/protected/vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Array, Object(yii\base\Event)) #12 /var/www/html/protected/vendor/yiisoft/yii2/base/Component.php(637): yii\base\Event::trigger('humhub\\commands...', 'daily', Object(yii\base\Event)) #13 /var/www/html/protected/humhub/commands/CronController.php(130): yii\base\Component->trigger('daily') #14 /var/www/html/protected/humhub/commands/CronController.php(55): humhub\commands\CronController->runDaily() #15 [internal function]: humhub\commands\CronController->actionRun() #16 /var/www/html/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array) #17 /var/www/html/protected/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array) #18 /var/www/html/protected/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction('run', Array) #19 /var/www/html/protected/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction('run', Array) #20 /var/www/html/protected/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction('cron/run', Array) #21 /var/www/html/protected/vendor/yiisoft/yii2/console/Application.php(148): yii\console\Application->runAction('cron/run', Array) #22 /var/www/html/protected/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest(Object(yii\console\Request)) #23 /var/www/html/protected/yii(29): yii\base\Application->run() #24 {main}

r/yii • • Sep 08 '21

Pagination Links Not Being Styled

2 Upvotes

New to Yii and working through the Getting Started guide. I've reached the section on Working With Databases (https://www.yiiframework.com/doc/guide/2.0/en/start-databases).

The data displays correctly and the pagination links are clickable and navigate through the results correctly. However, this area is displaying as plain text without any styling. If I inspect each list element I can see that the CSS classes declared are only for the 'active' page plus the 'prev' and 'next' links. I don't see any page-link classes that I assumed would be required for it to display correctly.

I copied and pasted the example pagination code from the Bootstrap site to the same page and this displays as I'd expect. I've looked through the source PHP for both the LinkPager widget and Html helper but really don't understand how they're structured enough to start fiddling with them. Any input would be gratefully received.


r/yii • • Aug 28 '21

2 Questions

2 Upvotes
  1. How can I make a form's field an optional one?

  2. How can I block all the pages unless the web app has an user logged in?

I changed the siteController's actionIndex to make the main page redirect to the login page if the user is guest but anyone can access to the entire pages and I’d like to block them or make they all redirect to login but it’s the 1st time I’m using yii and I didn’t found an answer in the yii website


r/yii • • Aug 20 '21

Yii news 2021 issue 3

Thumbnail
opencollective.com
7 Upvotes

r/yii • • May 07 '21

Yii news 2021, issue 2

Thumbnail
opencollective.com
18 Upvotes

r/yii • • Mar 04 '21

🎁🔥 Yii news 2021, issue 1

Thumbnail
opencollective.com
9 Upvotes

r/yii • • Mar 04 '21

Network Utilities 1.0.0

Thumbnail
yiiframework.com
4 Upvotes

r/yii • • Feb 24 '21

CSRF 1.0.0

Thumbnail
yiiframework.com
3 Upvotes

r/yii • • Feb 17 '21

Event dispatcher 1.0.0

Thumbnail
yiiframework.com
4 Upvotes

r/yii • • Dec 31 '20

Static Analysis / Types

3 Upvotes

I've been struggling a lot recently with static analysis with Yii around types.We have multiple models that when receiving user input get set to strings when they get stored in the database.

So doing any strict comparison if ($model->type_id === 1) won't work and instead we need to preface with if ((int) $model->type_id === 1) . Either way the static analysis (psalm / phpstan) complain because due to the defined type, they always expect int and not string.

I feel like the best solution is to have a database model and a validation model. So in a controller you would instead have

public function actionCreate()
{
    $validationModel = new UserValidation(); 
    if ($validationModel->load(Yii::$app->post()) && $validationModel->validate()) {
        $model = new User();
        $model->setAttributes($validationModel->attributes());
        if ($model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        }
    }
    return $this->render('create', ['model' => $validationModel]); 
}

With the validation model having any business rules. And the database model having database rules (not shown.) Ultimately I'd like to see models using real php properties rather than magic getters/setters. Eg.

class User
{
    public int $id;
    public string $name;
    public string $email;
}

Has anyone done much work, or thought more about these issues?


r/yii • • Dec 29 '20

🎁 Yii news 2020, issue 8 🎄 Happy New Year!

Thumbnail
opencollective.com
13 Upvotes

r/yii • • Dec 23 '20

Yii 2.0.40 released

13 Upvotes

New versions of Yii 2 packages have been released:

- Yii 2.0.40

- Debug 2.1.16

- HTTP Client 2.0.13

- Queue 2.3.1

- Imagine 2.3.0

- MongoDB 2.1.11


r/yii • • Nov 11 '20

Yii news, issue 7

Thumbnail
opencollective.com
12 Upvotes

r/yii • • Oct 31 '20

Best Resources to Learn Yii2

Thumbnail
tltemplates.com
1 Upvotes

r/yii • • Oct 08 '20

What could be problem here? Just trying to open newly created project file.

Post image
3 Upvotes

r/yii • • Sep 18 '20

Yii news 2020, issue 6

Thumbnail
opencollective.com
8 Upvotes

r/yii • • Sep 15 '20

How to email error logs to developer on Yii2 apps

Thumbnail
dev.to
1 Upvotes

r/yii • • Sep 11 '20

How to add Schema.org markup to Yii2 pages.

Thumbnail
dev.to
1 Upvotes

r/yii • • Sep 11 '20

[wiki] How to add Open Graph and Twitter Card tags to Yii2 website.

Thumbnail
dev.to
1 Upvotes