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


PHP Video::getInstance方法代码示例

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


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

示例1: actionDisplay

 public function actionDisplay()
 {
     $id = Request::getVar('id', null);
     $alias = Request::getVar('alias', null);
     $model = Video::getInstance();
     if ($id == null or $id == "") {
         if ($alias != null and $alias != "") {
             $obj_item = $model->getItemByAlias($alias);
         } else {
             header("Location: /");
         }
     } else {
         $obj_item = $model->getItem($id);
     }
     $items = $model->getItems($obj_item['catID'], true, 4);
     $items2 = $model->getItems($obj_item['catID'], false, 9);
     $obj_category = $model->getCategory($obj_item['catID']);
     $data['item'] = $obj_item;
     $data['items'] = $items;
     $data['items2'] = $items2;
     $data['category'] = $obj_category;
     $page_title = $obj_item['title'];
     $page_keyword = $obj_item['metakey'] != "" ? $obj_item['metakey'] : $page_title;
     $page_description = $obj_item['metadesc'] != "" ? $obj_item['metadesc'] : $page_title;
     setSysConfig("seopage.title", $page_title);
     setSysConfig("seopage.keyword", $page_keyword);
     setSysConfig("seopage.description", $page_description);
     Request::setVar('alias', $obj_category['alias']);
     $this->render('default', $data);
 }
开发者ID:ducdm87,项目名称:gamelienminh,代码行数:30,代码来源:DetailController.php

示例2: actionEdit

 public function actionEdit()
 {
     $cid = Request::getVar('cid', "");
     setSysConfig("sidebar.display", 0);
     $this->addIconToolbar("Save", Router::buildLink("videos", array('layout' => 'save')), "save");
     $this->addIconToolbar("Apply", Router::buildLink("videos", array('layout' => 'apply')), "apply");
     $this->addBarTitle("Video <small>[Edit]</small>", "user");
     $this->addIconToolbar("Close", Router::buildLink("videos", array('layout' => 'cancel')), "cancel");
     $this->pageTitle = "Edit video";
     $model = Video::getInstance();
     $item = $model->getItem($cid);
     global $user;
     if (!($bool = $user->modifyChecking($item->created_by))) {
         $obj_users = YiiUser::getInstance();
         $item_user = $obj_users->getUser($item->created_by);
         YiiMessage::raseNotice("Your account not have permission to edit resource of: {$item_user->username}");
         $this->redirect(Router::buildLink("article"));
         return false;
     }
     $list = $model->getListEdit($item);
     $this->render('edit', array("item" => $item, "list" => $list));
 }
开发者ID:ducdm87,项目名称:gamelienminh,代码行数:22,代码来源:homeController.php

示例3: actionBlog

 public function actionBlog()
 {
     $model = Video::getInstance();
     $catAlias = Request::getVar('alias', null);
     $catID = Request::getVar("id");
     $currentPage = Request::getVar('page', 1);
     $limit = 12;
     $data['alias'] = $catAlias;
     $obj_category = $model->getCategory($catID, $catAlias);
     if ($obj_category == false) {
         $this->redirect(Router::buildLink('videos'));
     }
     if ($currentPage == 1) {
         $data['items'] = $model->getItems($obj_category['id'], true, 5);
     }
     $start = ($currentPage - 1) * $limit;
     $data['items2'] = $model->getItems($obj_category['id'], false, $limit, $start);
     if ($obj_category['total'] > $start + $limit) {
         $page = $currentPage + 1;
     } else {
         $page = $currentPage - 1;
     }
     $catAlias = $obj_category['alias'];
     $params = array("view" => "category", "id" => $obj_category['id'], "alias" => $obj_category['alias'], "page" => $page);
     $obj_category['pagemore'] = Router::buildLink('videos', $params);
     $page_title = $obj_category['title'];
     if ($currentPage > 1) {
         $page_title = $page_title . " trang {$currentPage}";
     }
     $page_keyword = $obj_category['metakey'] != "" ? $obj_category['metakey'] : $page_title;
     $page_description = $obj_category['metadesc'] != "" ? $obj_category['metadesc'] : $page_title;
     setSysConfig("seopage.title", $page_title);
     setSysConfig("seopage.keyword", $page_keyword);
     setSysConfig("seopage.description", $page_description);
     $data['category'] = $obj_category;
     $this->render('blog', $data);
 }
开发者ID:ducdm87,项目名称:gamelienminh,代码行数:37,代码来源:CategoryController.php


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