{{@title.name}}<br/>
{{isset(@title.name)?'YEP':'NOPE'}}<br/>JohnsonNOPE
3.6.0 (19 November 2016)"bcosca/fatfree": "dev-master",
{{@title.name}}$f3 = require 'base.php';$f3 = \Base::instance();vendor\bcosca\fatfree\lib
require_once __DIR__ . '\vendor\autoload.php';
$f3 = Base::instance();
$f3->config('app/config/config.ini');
$f3->config('app/config/routes.ini');
$f3->run();
class Controller {
//Main Variables include DB
protected $f3;
protected $db;
function __construct() {
$f3=Base::instance();
$this->f3=$f3;
$db=new DB\SQL(
$f3->get('dbdmd'),
$f3->get('dbusername'),
$f3->get('dbpassword'),
array( \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION )
);
$this->db=$db;
}
}{{!empty(@title.name)?'YEP':'NOPE'}}{{isset(@title.name)?'YEP':'NOPE'}}{{ (@title.name)?'YEP':'NOPE'}} it will work
1. {{!empty(@data.name)?'YEP':'NOPE'}}<br>
2. {{isset(@data.name)?'YEP':'NOPE'}}<br>
3. {{ (@data.name)?'YEP':'NOPE'}}<br> 1. NOPE
2. NOPE
3. YEPdomain.com/route1/@id/update$this->f3->set('data', $data);
$this->f3->set('view', 'mypage.htm'); // Set the main view $template=new Template; echo $template->render('layout.htm'); // Call main layout<pre>{{ var_dump(@data) }}</pre>My other pages use the same code to send data to the template, however they are loading data from POST instead of the database is all. I don't see why these use cases would be any different to isset and empty ?
["fields":protected]=>
array(17) {
["name"]=>
array(8) {
["type"]=>
string(12) "varchar(255)"
["pdo_type"]=>
int(2)
["default"]=>
NULL
["nullable"]=>
bool(false)
["pkey"]=>
bool(false)
["value"]=>
string(20) "John (Johnny)"
["initial"]=>
string(20) "John (Johnny)"
["changed"]=>
bool(false)
}