2. Szablony – Bootstrap UI

https://github.com/FriendsOfCake/bootstrap-ui

  1. Instalacja i uruchomienie pluginu
  2. Skopiowanie assetów
  3. AppView – uruchomienie treat’u   initializeUI
  4. Wygenerowanie szablonów typu BootstrapUI

Plugin friendsofcake/bootstrap-ui

# composer require friendsofcake/bootstrap-ui
# bin/cake plugin load BootstrapUI

src/View/AppView.php

declare(strict_types=1);

namespace App\View;

use BootstrapUI\View\UIViewTrait;
use Cake\View\View;

class AppView extends View
{
    use UIViewTrait;

    public function initialize(): void
    {
        parent::initialize();

        // Call the initializeUI method from UIViewTrait
        $this->initializeUI();
    }
}

Skopiowanie przykładowych layoutów:

# cp -R vendor/friendsofcake/bootstrap-ui/templates/layout/examples templates/layout/TwitterBootstrap
# bin/cake bake template Companies -t BootstrapUI

Szablon loginu generuje się oddzielnie

# bin/cake bake template ControllerName login -t BootstrapUI

Sprawdzenie jakie modele / tabele mogą być wygenerowane

$ bin/cake bake template -t BootstrapUI

template, controller, model, all
// Utworzenie tylko szablonu index dla projektów
# bin/cake bake template Projects index -t BootstrapUI