Some useful php libraries for easing code :)
$db = new DB();
$db->table('tablename');
// Fetching results
DB::table('tablename')->get(); // will fetch every result from table
$query = DB::table('tablename')->query("SELECT col, FROM @table . . .");
// @table refer to current table reference, if set with table() method.
/**
* obj | array stash($type = '{}' || '[]')
* obj | array record($type = '{}' || '[]')
*
* $type parameter can be '{}' fetching results as object or '[]' for arrays
* $type parameter by default set to '{}'
*/
$db = new DB();
$query = $db->table('tablename')->get();
// single result
$result = $query->stash();
// for heap of results
$result = $query->record();
DB::table('tablename')->get('column')
DB::table('tablename')->get([
'cols' => ['col1', 'col2', 'col3', 'col4']
])
$db = new DB();
$db->table('tablename') // set table
// tablename will be set automatically as table reference for every query you made
$query1 = $db->get(); // no need to set table again
$result = $query1->stash();
$query2 = $db->where('col1', 'value')->get('col1'); // same for here
$result = $query2->stash();
Assets::bootstrap([
'filename1' => [
'css' => [
"path/to/style.css" ...
],
'js' => [
"path/to/script.js" ...
]
],
'filename2' => [
'css' => [],
'js' => []
]
]);
Assets::bootstrap([
'filename1 | filename2' => [
'css' => [
"path/to/style.css" ...
],
'js' => [
"path/to/script.js" ...
]
]
]);
// You can add as much filenames as you want
If you're not using routing simple edit the bool isfile(string $file)
method according to your need.