Skip to content

Instantly share code, notes, and snippets.

@jorgecc
Created October 16, 2018 03:29
Show Gist options
  • Save jorgecc/e72d6bde3ac3f5bfb2b79692d24dde35 to your computer and use it in GitHub Desktop.
Save jorgecc/e72d6bde3ac3f5bfb2b79692d24dde35 to your computer and use it in GitHub Desktop.
<?php
include "vendor/autoload.php"; // it is crap, I will explain it later.
include "dao/ProductDao.php";
// view
$blade=new \eftec\bladeone\BladeOne(__DIR__."/view",__DIR__."/compile");
$blade->setMode(\eftec\bladeone\BladeOne::MODE_DEBUG);
// persistence
$db=new \eftec\DaoOne("localhost","root","abc.123","bladeonetut1");
$db->connect();
// this page is a single stage:
// it loads the list of products
// and it shows on the webpage
$list=\BladeOneTut1\ProductDao::list();
echo $blade->run("product.list1",['products'=>$list]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment