Hi there, I used to use CodeIgnter but after a yer wating for PHP5 I get bored.
Today I started to use Flourish and I want to know som best practices using Flourish
VIEWS
#!text/html
$db = new fDatabase('mysql', 'database', 'root', 'root');
$items = $db->query('SELECT * FROM items LIMIT 3');
$template = new fTemplating('views/');
$template->set('page', 'index.php');
$template->set('items', $items);
$template->place('pagina');
#!text/html
<html>
<head>
<title></title>
</head>
<body>
<ul>
<?php foreach ( $items as $item ) : ?>
<li><?php echo $item['barcode']; ?></li>
<?php endforeach; ?>
</ul>
</body>
</html>
I get a beautiful Invalid argument supplied for foreach() so I tried to use a include instead place() and it works fine.
Code Igniter way
$data['items'] = $this->db->get('items', 3);
$this->load->view('index', $data);