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


PHP Display::instance方法代码示例

本文整理汇总了PHP中Display::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Display::instance方法的具体用法?PHP Display::instance怎么用?PHP Display::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Display的用法示例。


在下文中一共展示了Display::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct()
 {
     parent::__construct();
     parent::init();
     acl_helper::acl_redirect(steamauth_helper::get_role(), 'admin');
     Display::instance()->set_template('template-admin');
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:7,代码来源:plugins_admin.php

示例2: error_404_listener

 /**
  * listener for error 404s
  *
  * @return void
  * @author Andy Bennett
  */
 function error_404_listener()
 {
     header('HTTP/1.1 404 File Not Found');
     Display::instance()->set_template('template-error');
     Display::instance()->add_data('page_id', 'page-not-found');
     View::factory('common/error_404')->render(true);
     die;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:14,代码来源:steam_events.php

示例3: render

 /**
  * render
  *
  * @return void
  * @author Andy Bennett
  */
 public static function render()
 {
     $content = array();
     $content['content'] = new stdClass();
     $content['content']->title = '';
     $content['content']->copy = Event::$data;
     $container = Container::instance(1)->render($content, null);
     Display::instance()->display($container);
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:15,代码来源:blog_listeners.php

示例4: render

 /**
  * render list of plugins
  *
  * @param string $copy 
  * @return void
  * @author Andy Bennett
  */
 function render($copy)
 {
     $admin_container = Kohana::config('containers.admin_container');
     $content = new stdClass();
     $content->header = 'Containers Admin';
     $content->sub_header = '';
     $content->copy = $copy;
     $page_content = Container::instance()->init($admin_container)->render($content);
     Display::instance()->display($page_content);
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:17,代码来源:plugins_admin.php

示例5: __construct

 function __construct()
 {
     if (!User::instance()->id) {
         url::redirect('/auth/login');
     }
     Acl::instance()->redirect(User::instance()->get_role(), 'admin', null, '/auth/login');
     parent::__construct();
     $type = '-' . Input::instance()->get('type', '');
     Display::instance()->set_template($type == '-' ? 'template' : 'template' . $type);
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:10,代码来源:Steam_ordered.php

示例6: item_html_listener

 public static function item_html_listener()
 {
     $pid = Event::$data['data']['row']->pid;
     $cid = Event::$data['data']['row']->container;
     $content = array();
     $content['content'] = new stdClass();
     $content['content']->title = Event::$data['data']['row']->title;
     $content['content']->copy = View::factory('pages/' . Event::$data['view'], Event::$data['data'])->render();
     $container = Container::instance($cid)->render($content, false, $pid);
     Display::instance()->display($container);
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:11,代码来源:page_listeners.php

示例7: add_map

 public static function add_map($data = array(), $args = null)
 {
     self::append_js();
     $map = new View('gmap');
     $map->set('result', $data);
     if (is_object($args)) {
         foreach ($args as $a => $v) {
             $map->{$a} = $v;
         }
     }
     $extraHeadContent = $map->render();
     Display::instance()->append_data('extraHeadContent', $extraHeadContent);
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:13,代码来源:Gmaps.php

示例8: item_html_listener

 public static function item_html_listener()
 {
     $pid = Event::$data['data']['row']->pid;
     $cid = Event::$data['data']['row']->container;
     $content_template = Event::$data['data']['row']->content_template;
     $content_template = $content_template == '' ? 'template-0' : $content_template;
     $content = array();
     $content['content'] = new stdClass();
     $content['content']->title = Event::$data['data']['row']->title;
     $content['content']->copy = View::factory('/containers/content_templates/' . $content_template, Event::$data['data'])->render();
     Display::instance()->add_data('page_version', Event::$data['data']['row']->version);
     $container = Container::instance($cid)->render($content, false, $pid);
     Display::instance()->display($container);
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:14,代码来源:page_listeners.php

示例9: index

 /**
  * Get plugins and show
  *
  * @return void
  * @author Dan Chadwick
  */
 public function index()
 {
     Event::add('steamcore.aclcheck', array('acl_listeners', 'redirect'));
     $data = array('action' => 'admin', 'name' => null, 'role' => User::instance()->get_role());
     Event::run('steamcore.aclcheck', $data);
     Assets::instance()->add_css('admin');
     $view = View::factory('plugins_list');
     $view->plugins = PluginManager::instance()->getPluginObjects();
     $content = array('content' => new stdClass());
     $content['content']->title = 'Plugins Admin';
     $content['content']->copy = $view->render();
     Assets::instance()->add_css('/cache/css/display');
     Assets::instance()->add_javascript('/cache/js/display');
     Display::instance()->display(Container::instance('display')->render($content));
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:21,代码来源:plugins.php

示例10: admin

 /**
  * listing
  *
  * @return void
  * @author Andy Bennett
  */
 public function admin()
 {
     $data = array('action' => 'edit', 'name' => $this->name, 'role' => User::instance()->get_role());
     Event::run('steamcore.aclcheck', $data);
     $blog = URI::instance()->segment(3, 1);
     $nodes = ORM::factory('blogpost')->where(array('lvl' => 1, 'blog_id' => $blog))->orderby(array('date_added' => 'DESC'))->find_all();
     $lvl = ORM::factory('blogpost')->level_column;
     $data = array('nodes' => $nodes, 'level_column' => $lvl, 'controller' => 'blogposts');
     $copy = View::factory('blog/postslist_admin', $data)->render();
     $content = array();
     $content['content'] = new stdClass();
     $content['content']->title = 'Blog Posts';
     $content['content']->copy = $copy;
     $container = Container::instance(3)->render($content);
     Display::instance()->display($container);
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:22,代码来源:Blog.php

示例11: getContentBody

 /**
  * get content body
  *
  * @return void
  * @author Andy Bennett
  */
 function getContentBody()
 {
     $blog = Blog::factory();
     // var_dump($blog);exit;
     $data = array();
     if (count(Router::$arguments) > 1) {
         Display::instance()->add_data('pageclass', 'blog-subpage');
         $plugdata = array('content' => $blog->view(), 'comment' => $blog->comment(), 'p' => $this);
         $data['content'] = View::factory('blog/plugin-post', $plugdata)->render();
     } else {
         $plugdata = array('content' => $blog->blog(1), 'p' => $this);
         $data['content'] = View::factory('blog/plugin-posts', $plugdata)->render();
     }
     $data['comments'] = $blog->latest_comments(1, 5);
     $data['p'] = $this;
     return View::factory('blog/plugin-wrapper', $data)->render();
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:23,代码来源:AbstractBlogPlugin.php

示例12: admin

 public function admin()
 {
     $data = array('action' => 'edit', 'name' => $this->name, 'role' => User::instance()->get_role());
     Event::run('steamcore.aclcheck', $data);
     $root = ORM::factory('pages_position')->where('lft', 0)->find();
     $xml = $root->render_descendants('pages', false)->render();
     $l = xsl::translate_string($xml, 'pages_admin', array(), array('pages_helper::check_acl'));
     $pages = pages_helper::get_pages($root = true);
     $move = View::factory('pageadmin/movepage', array('pagelist' => $pages))->render();
     $c = View::factory('pages/pages', array('list' => $l, 'controller' => 'pages', 'move' => $move))->render();
     $content = array();
     $content['content'] = new stdClass();
     $content['content']->title = 'Pages';
     $content['content']->copy = $c;
     $container = Container::instance(3)->render($content);
     Display::instance()->display($container);
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:17,代码来源:Pages.php

示例13: init

 /**
  * initialise the container
  *
  * @param string $container_id 
  * @param boolean $use_defaults 
  * @return void
  * @author Andy Bennett
  */
 function init($container_id, $use_defaults = true)
 {
     $this->container_id = $container_id;
     $details = $this->model->get_container($this->container_id);
     if (!is_object($details)) {
         throw new Kohana_User_Exception("Containers Error", "Container id " . $container_id . " cannot be found");
     }
     $this->title = $details->title;
     $this->template = $details->template;
     if ($use_defaults) {
         $this->add_block('left_column', array('column' => 'left-col'));
         $this->add_block('mid_column', array('column' => 'middle-col'));
         $this->add_block('right_column', array('column' => 'right-col'));
         $this->add_block('section_nav', array('column' => 'nav'));
     }
     Display::instance()->set_container(true);
     return $this;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:26,代码来源:Container.php

示例14: index

 /**
  * display the tree
  *
  * @return void
  * @author Andy Bennett
  */
 public function index()
 {
     Display::instance()->add_css('app/admin');
     Display::instance()->add_css('app/apage');
     // $filepath = Kohana::find_file( 'xml', 'sitemap', true, 'xml');
     // $xml = simplexml_load_file( $filepath );
     $xml = Sitemap::instance()->get_sitemap();
     Display::instance()->add_css('/cache/css/tree');
     Display::instance()->add_javascript('global/core/effects');
     Display::instance()->add_javascript('global/core/dragdrop');
     Display::instance()->add_javascript('/cache/js/Tree');
     $js = new View('tree_js', array('struct' => tree_helper::create_struct($xml)), FALSE);
     Display::instance()->append_data('extraHeadContent', $js);
     $content = new stdClass();
     Display::instance()->add_data('header', 'Pages Admin');
     Display::instance()->add_data('sub_header', '');
     $tb = new View('tree_body');
     $content = $tb;
     Display::instance()->add_data('content', $content);
     Display::instance()->display();
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:27,代码来源:tree.php

示例15: comments_list

 /**
  * get list of comments
  *
  * @param string $post_id 
  * @return void
  * @author Andy Bennett
  */
 public function comments_list($post_id)
 {
     try {
         $node = ORM::factory('blogpost', $post_id);
         if ($node->has_children()) {
             $data = array();
             $data['post_title'] = $node->title;
             $data['nodes'] = $node->descendants()->find_all();
             $data['controller'] = 'blog_comments';
             $copy = View::factory('blog/post_comments_admin', $data)->render();
             $content = array();
             $content['content'] = new stdClass();
             $content['content']->title = 'Blog Post Comments';
             $content['content']->copy = $copy;
             $container = Container::instance(3)->render($content);
             Display::instance()->display($container);
         }
     } catch (Exception $e) {
         var_dump($e->getMessage());
         Kohana::log('debug', $e->getMessage());
     }
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:29,代码来源:blog_comments.php


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