當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。