本文整理汇总了PHP中Layout::findById方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::findById方法的具体用法?PHP Layout::findById怎么用?PHP Layout::findById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::findById方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
// This allows us to check if we're being called in the front or the back.
if (defined("CMS_BACKEND")) {
$this->setLayout('backend');
$this->assignToLayout("sidebar", new View("../../plugins/themer/views/sidebar"));
} else {
$settings = Plugin::getAllSettings("themer");
$layout = Layout::findById($settings["layout"]);
$this->setLayout($layout->name);
}
}
示例2: _edit
function _edit($id)
{
$layout = Layout::findById($id);
$layout->setFromData($_POST['layout']);
if (!$layout->save()) {
Flash::set('error', __('Layout has not been saved. Name must be unique!'));
redirect(get_url('layout/edit/' . $id));
} else {
Flash::set('success', __('Layout has been saved!'));
Observer::notify('layout_after_edit', $layout);
}
// save and quit or save and continue editing?
if (isset($_POST['commit'])) {
redirect(get_url('layout'));
} else {
redirect(get_url('layout/edit/' . $id));
}
}
示例3: edit
function edit($id)
{
if (!($layout = Layout::findById($id))) {
Flash::set('error', __('Layout not found!'));
redirect(get_url('layout'));
}
// check if trying to save
if (get_request_method() == 'POST') {
return $this->_edit($id);
}
// display things...
$this->display('layout/edit', array('csrf_token' => SecureToken::generateToken(BASE_URL . 'layout/edit'), 'action' => 'edit', 'layout' => $layout));
}
示例4: isset
?>
)</small><?php
}
?>
<img align="middle" alt="" class="busy" id="busy-<?php
echo $child->id;
?>
" src="<?php
echo PATH_PUBLIC;
?>
wolf/admin/images/spinner.gif" title="" />
</span>
</div>
<div class="page-layout"><?php
$layout = Layout::findById($child->layout_id);
echo isset($layout->name) ? htmlspecialchars($layout->name) : __('inherit');
?>
</div>
<?php
switch ($child->status_id) {
case Page::STATUS_DRAFT:
echo '<div class="status draft-status">' . __('Draft') . '</div>';
break;
case Page::STATUS_PREVIEW:
echo '<div class="status preview-status">' . __('Preview') . '</div>';
break;
case Page::STATUS_PUBLISHED:
echo '<div class="status published-status">' . __('Published') . '</div>';
break;
case Page::STATUS_HIDDEN:
示例5: layout
public function layout()
{
if ($this->layoutId()) {
return Layout::findById($this->layoutId());
} else {
return $this->parent()->layout();
}
}
示例6: get_url
echo get_url('page/edit/1');
?>
" title="/"><img align="middle" class="icon" src="<?php
echo PATH_PUBLIC;
?>
wolf/admin/images/page.png" alt="page icon" /> <span class="title"><?php
echo $root->title;
?>
</span></a>
<?php
}
?>
</span>
</div>
<div class="page-layout"><?php
echo Layout::findById($root->layout_id)->name;
?>
</div>
<div class="status published-status"><?php
echo __('Published');
?>
</div>
<div class="view-page"><a href="<?php
echo URL_PUBLIC;
?>
" target="_blank"><img src="<?php
echo PATH_PUBLIC;
?>
wolf/admin/images/magnify.png" align="middle" alt="<?php
echo __('View Page');
?>