當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Video::addVideo方法代碼示例

本文整理匯總了PHP中Video::addVideo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Video::addVideo方法的具體用法?PHP Video::addVideo怎麽用?PHP Video::addVideo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Video的用法示例。


在下文中一共展示了Video::addVideo方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onSubmit

 /**
  * Process the form on POST submission.  If you return false from getFormFields(),
  * this will obviously never be reached.  If you don't want to do anything with the
  * form, just return false here
  * @param  $data Array
  * @return Bool|Array true for success, false for didn't-try, array of errors on failure
  */
 public function onSubmit($data)
 {
     // Record upload and update metadata cache
     $this->video = Video::newFromName($this->oldvideo->ov_name, $this->getContext());
     $this->video->addVideo($this->oldvideo->ov_url, $this->oldvideo->ov_type, '');
     return true;
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:14,代碼來源:RevertVideoAction.php

示例2: submit

 /**
  * Actually inserts the Video into the DB if validation passes
  *
  * @param $data Array
  * @return bool
  */
 public function submit(array $data)
 {
     list($url, $provider) = $this->getUrlAndProvider($data['Video']);
     $this->video->addVideo($url, $provider, false, $data['Watch']);
     $this->getOutput()->redirect($this->video->getTitle()->getFullURL());
     return true;
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:13,代碼來源:SpecialAddVideo.php

示例3: actionCreate

 /**
  * Создает новое видео 
  */
 public function actionCreate()
 {
     self::checkAdmin();
     if (isset($_POST['submit'])) {
         $title = Validate::cleanStr($_POST['title']);
         $descr = Validate::cleanStr($_POST['descr']);
         if (!empty($title) && !empty($descr)) {
             //выбираем код видео из ссылки ютуб
             $video = Validate::cleanLinkYoutube($descr);
             $result = Video::addVideo(['title', 'descr', 'pubTime'], [$title, $video, time()]);
         }
         $res = isset($result) ? 'suc_video_create' : 'fail_video_create';
     } else {
         $res = 'fail_video_create';
     }
     header('Location:' . Config::ADDRESS . 'admin/video/?res=' . $res);
 }
開發者ID:echmaster,項目名稱:bit,代碼行數:20,代碼來源:AdminVideoController.php


注:本文中的Video::addVideo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。