Jumat, 24 April 2015

create sample application with GII

Buat database baru dengan 2 tabel



install yii2 basic from composer

C:\xampp183\php>
C:\xampp183\php>php composer.phar global require "fxp/composer-asset-plugin:1.0.

C:\xampp183\php>php.exe composer.phar create-project yiisoft/yii2-app-basic ../h
tdocs/basic4

edit file web.php di c:\xampp183\htdocs\basic4\config
tambahkan baris ini

        'urlManager'=>[
            'enablePrettyUrl' => true,
            'showScriptName' => false,
        ],


buat file .htaccess di folder web dan isi kode ini

    # use mod_rewrite for pretty URL support
    RewriteEngine on
    # If a directory or a file exists, use the request directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # Otherwise forward the request to index.php
    RewriteRule . index.php