当前位置: 首页>>代码示例>>PHP>>正文


PHP Layout::findById方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:svanlaere,项目名称:wolfcms-wordpress-admintheme,代码行数:12,代码来源:ThemerController.php

示例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));
     }
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:18,代码来源:LayoutController.php

示例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));
 }
开发者ID:ariksavage,项目名称:superior-optical-eyewear,代码行数:13,代码来源:LayoutController.php

示例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:
开发者ID:ariksavage,项目名称:superior-optical-eyewear,代码行数:31,代码来源:children.php

示例5: layout

 public function layout()
 {
     if ($this->layoutId()) {
         return Layout::findById($this->layoutId());
     } else {
         return $this->parent()->layout();
     }
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:8,代码来源:Page.php

示例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');
?>
开发者ID:ariksavage,项目名称:superior-optical-eyewear,代码行数:31,代码来源:index.php


注:本文中的Layout::findById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。