PHP Galau MVC ala Abal Abal

PHP Galau ini saya buat hari minggu kemarin, saat – saat saya sedang Galau. Hehehe …

 Seharusnya ada kata pengantar disini, tapi berhubung saya galau jadi males nulis😛 .

 

Pengenalan Singkat

Controller

Apps/Controllers/Contoh.php


<?php

class Contoh extends \Wawans\Controller\Controller
{
public function index()
{
$assign['msg'] = "Selamat Datang!";
$this->render('Contoh.layout', $assign);
}
}

View

Apps/Views/Contoh.layout.php


<h1>Hai, <?php echo $msg; ?></h1>

Model

Apps/Models/ContohModel.php


<?php

class ContohModel extends \Wawans\Model\Model
{
public function selectAll()
{
$que = $this->query("SELECT * FROM nama_table");
$que->execute();

return $que->fetchAll();
}
}

URL

Asumsikan anda menginstall di http://localhost/ , Controller diatas dapat diakses melalui :

http://localhost/@Controller/@Method/@Parameters

Kebutuhan Sistem Minimal

  • PHP versi >= 5.3

Struktur Folder

PHP GALAU MVC

Download

https://app.box.com/s/o7t8smi7qo7kxhez5ghw

Ada Pertanyaan ?

Silahkan kirimkan pertanyaan anda ke surel saya :

 

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s