Unsorted Notes
Voor- nadelen Laravel v. Yii
Laravel | YII | |
MVC | ✓ | ✓ |
Model | Eloquent | Active Record |
View/templating | Blade | PHP met 'Yii Snippets' |
Routing | Expliciet | Impliciet / Expliciet |
Migrations | ✓ |
✓ (meer als optie) |
Model creations | command line |
GUI, reverse engineered form DB |
Controller Creation | command line |
GUI, create full CRUD |
View creation | ? |
GUI, create full CRUD |
Documentation | *** |
** |
Active development | ✓ | ✓ |
Add Ons / Libraries | *** | ** |
Install Base (volgens Google) | 484,970 | 58,800 |
Grootste voordeel is de GUI waarmee je reverse engineered een CRUD maakt.
Install Datepicker
(in project root)
change in file composer.dev "minimum-stability": "dev",
composer clear-cache
composer require kartik-v/yii2-widget-datepicker
https://github.com/kartik-v/yii2-widget-datepicker
Create (temporary swap on Ubuntu)
free -m
total used free shared buffers cached
Mem: 2048 357 1690 0 0 237
-/+ buffers/cache: 119 1928
Swap: 0 0 0
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors
Install Bootstrap 4
composer require --prefer-dist yiisoft/yii2-bootstrap4
Redirect
return $this->redirect(['view', 'id' => $model->id]);
Post form on dropdown change
<select name="status" id="status" onchange="this.form.submit()">