本文整理汇总了PHP中Check::id方法的典型用法代码示例。如果您正苦于以下问题:PHP Check::id方法的具体用法?PHP Check::id怎么用?PHP Check::id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Check
的用法示例。
在下文中一共展示了Check::id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_function
protected function get_function($url)
{
if (empty($url[2]) || !Check::id($url[2])) {
throw new Error_Read_Edit();
}
$this->data['id'] = (int) $url[2];
$this->data['type'] = $this->get_type();
$this->template = 'edit/' . $this->data['type'] . '/' . $url[1];
return $url[1];
}
示例2: __construct
public function __construct($reader, $writer)
{
parent::__construct($reader, $writer);
$data = $this->reader->get_data();
if (empty($data['id']) || !Check::id($data['id'])) {
throw new Error_Update('Incorrect Id');
}
$model = new Model_Post_Update($data['id']);
$model->load();
if ($model->is_phantom()) {
throw new Error_Update('Incorrect Id');
}
$this->model = $model;
}
示例3: __construct
public function __construct($reader, $writer)
{
parent::__construct($reader, $writer);
$data = $this->reader->get_data();
if (empty($data['id']) || !Check::id($data['id'])) {
throw new Error_Update('Incorrect Id');
}
$model = new Model_Video($data['id']);
$model->load();
if ($model->is_phantom()) {
throw new Error_Update('Incorrect Id');
}
if ($model['area'] != 'workshop' && !sets::user('rights')) {
throw new Error_Update('Not enough rights');
}
$this->model = $model;
}