PHP code example of fadli-dev / treant

1. Go to this page and download the library: Download fadli-dev/treant library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fadli-dev / treant example snippets


  untuk mengakses image
  <img src="<?= asset('yourasset.jpg') 

View::render('home',[],'layout'); <-- maksud dari code ini adalah kita mengarahkan kehalaman home,
[] <-- tidak membawa parameter, 'layout' <-- jika memisahkan navbar dengan content

bisa juga menggunakan
View::redirectTo('/user'); <-- fungsi ini mengarahkan ke route misalkan /mvc/product <-- akan 
mengarahkan ke route product

dan bisa menggunakan basic