本文整理匯總了PHP中Kernel::instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kernel::instance方法的具體用法?PHP Kernel::instance怎麽用?PHP Kernel::instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Kernel
的用法示例。
在下文中一共展示了Kernel::instance方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInstance
public static function getInstance()
{
if (!self::$instance) {
self::$instance = new Kernel();
}
return self::$instance;
}
示例2: get
public function get()
{
if ($this->type == self::FORAIN_KEY) {
$model = Kernel::instance($this->refer);
$pk = $model->get_pk();
$models = $model->filter(array($pk->name() => parent::get()));
return isset($models[0]) ? $models[0] : '---';
} else {
if ($this->type == self::PRIMARY_KEY) {
return parent::get();
}
}
}
示例3: do_del
public function do_del()
{
$user = Session::get_user();
if ($user instanceof AdminUser && $user != null && $user->getVerified()) {
$model = $_GET['model'];
$object = Kernel::instance($model);
$object->setArray($_POST);
$r = $object->delete();
//var_dump($r);
if ($r) {
header('HTTP/1.0 200 OK');
header("Location: ?ID=show&model={$model}");
exit(0);
}
header('HTTP/1.0 406 Not Acceptable');
$pk = $object->get_pk()->val();
header("Location: ?ID=del&model={$model}&pk=" . $pk);
} else {
header("Location: ?ID=login");
}
}
示例4: getJobService
protected function getJobService()
{
return Kernel::instance()->service('JobService');
}