Benjamin Renard
4f47dc056d
* Move example application in example sub-directory * Widely use App::get() instead of Config::get()
22 lines
460 B
PHP
22 lines
460 B
PHP
<?php
|
|
|
|
use EesyPHP\Check;
|
|
use EesyPHP\Log;
|
|
use EesyPHP\Tpl;
|
|
|
|
function get_item_from_url($id, $fatal=false) {
|
|
if (!Check :: id($id))
|
|
Log :: fatal(_('Invalid element identifier.'));
|
|
|
|
$item = get_item($id);
|
|
if(!is_array($item)) {
|
|
$error = sprintf(_("Item #% s not found."), $id);
|
|
if ($fatal)
|
|
Log :: fatal($error);
|
|
Tpl :: add_error($error);
|
|
return false;
|
|
}
|
|
return $item;
|
|
}
|
|
|
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab
|