本文整理汇总了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;
}
示例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;
}
示例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);
}