Tutorial Sebelumnya:
Membuat menu / halaman baru Yii 2 Basic ( Yii 2 Basic Tutorial 2 )
1. Untuk membuat koneksi ke database isi db.php pada direktori \basic\config sesuai dengan database yang kalian telah buat
source code db.php:
<?php
return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=dboddsay',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
];
2. Untuk mencek koneksi, ubah isi fungsi actionHalamansatu di direktori \basic\controllers...
Showing posts with label YII Basic Tutorial. Show all posts
Showing posts with label YII Basic Tutorial. Show all posts
Monday, 23 May 2016
Membuat Koneksi Ke Database dan Mencek Koneksi ( Yii 2 Basic Tutorial 3 )
Posted on May 23, 2016 by Hasta Nurhusada
Membuat menu / halaman baru Yii 2 Basic ( Yii 2 Basic Tutorial 2 )
Posted on May 23, 2016 by Hasta Nurhusada
Yii 2 Basic Tutorial 1 (Cara menginstal Yii 2 Basic ( Yii 2 Basic Tutorial 1 )) kita telah berhasil menginstal dan menampilkan halaman depan Yii 2. Sekarang kita akan mencoba membuat halaman dan menu baru.
1. Buat halaman baru dengan menambahkan file halamansatu.php pada direktori basic\views\site\
source code halamansatu.php :
<?php
/* @var $this yii\web\View */
use yii\helpers\Html;
$this->title = 'Halaman Satu';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-about">
<h1><?=...
Cara menginstal Yii 2 Basic ( Yii 2 Basic Tutorial 1 )
Posted on May 23, 2016 by Hasta Nurhusada
Sebelum memulai tutorial pastikan sudah terinstal xampp atau sejenisnya. Download Yii 2 basic di http://www.yiiframework.com/download/, kemudian extrak pada htdocs xampp.
url project anda http://localhost/basic/web/
Error:
Invalid Configuration – yii\base\InvalidConfigException
yii\web\Request::cookieValidationKey must be configured with a secret key.
Menandakan cookieValidationKey belum diberikan nilai
- Buka basic\config\web.php
- Isikan :
'cookieValidationKey' => 'isikannilai'
kemudian buka...
Subscribe to:
Posts (Atom)