本文整理汇总了PHP中Block::put方法的典型用法代码示例。如果您正苦于以下问题:PHP Block::put方法的具体用法?PHP Block::put怎么用?PHP Block::put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block
的用法示例。
在下文中一共展示了Block::put方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Form
<?php
/**
* Block add form.
*/
$page->layout = 'admin';
if (!User::require_admin()) {
$this->redirect('/admin');
}
$f = new Form('post', 'blocks/add');
$f->verify_csrf = false;
if ($f->submit()) {
$b = new Block($_POST);
$b->put();
Versions::add($b);
if (!$b->error) {
$this->add_notification('Block added.');
$this->hook('blocks/add', $_POST);
if (isset($_GET['return'])) {
$this->redirect($_GET['return']);
}
$this->redirect('/blocks/admin');
}
$page->title = i18n_get('An Error Occurred');
echo i18n_get('Error Message') . ': ' . $b->error;
} else {
$b = new Block();
$b->id = $_GET['id'];
$b->access = 'public';
$b->yes_no = array('yes' => i18n_get('Yes'), 'no' => i18n_get('No'));
$b->failed = $f->failed;
示例2: Block
$res->success = false;
$res->error = __('Authorization required.');
echo json_encode($res);
return;
}
$error = false;
$o = new Block($_GET['id']);
if ($o->error) {
$error = $o->error;
} else {
foreach ($_POST as $k => $v) {
if ($k != $o->key && isset($o->data[$k])) {
$o->{$k} = $v;
}
}
if (!$o->put()) {
$error = $o->error;
} else {
Versions::add($o);
$_POST['id'] = $_GET['id'];
$this->hook('blocks/edit', $_POST);
}
}
$res = new StdClass();
if ($error) {
$res->success = false;
$res->error = $error;
} else {
$res->success = true;
$res->data = $_GET['id'];
}
示例3: e
{
// Extend the list query to filter by the qualification id
if ($this->jobId) {
$query->where('job_id', $this->jobId);
}
}
}
?>
This is a the update.htm view relative to the Qualifications controller:
<?php
Block::put('breadcrumb');
?>
<ul>
<li><a href="<?php
echo Backend::url('gatto/jobs/qualifications');
?>
">Qualifications</a></li>
<li><?php
echo e($this->pageTitle);
?>
</li>
</ul>
<?php
Block::endPut();
?>