本文整理汇总了PHP中Video::data方法的典型用法代码示例。如果您正苦于以下问题:PHP Video::data方法的具体用法?PHP Video::data怎么用?PHP Video::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Video
<?php
header("Content-type: application/json; charset = UTF-8");
require_once "init.php";
$videos = new Video();
if (!Input::exists()) {
$videos_list = $videos->display_weeks_by(1, 4, 'ASC');
$videos_list_results = $videos->data();
if (count($videos_list_results)) {
echo json_encode($videos_list_results);
}
} else {
if (isset($_POST['week_start']) && isset($_POST['week_end']) && isset($_POST['week_order'])) {
$wk_st = escape((int) $_POST['week_start']);
$wk_end = escape((int) $_POST['week_end']);
$ordering = escape((string) $_POST['week_order']);
$videos_list = $videos->display_weeks_by($wk_st, $wk_end, $ordering);
$videos_list_results = $videos->data();
if (count($videos_list_results)) {
echo json_encode($videos_list_results);
}
}
}
示例2: foreach
if (!$user->isLoggedIn()) {
Redirect::to('../index.php');
} else {
foreach ($_GET as $key => $value) {
if ($value == "") {
Redirect::to('../index.php');
}
}
if (Input::exists('get')) {
$video_entry = new Video();
$video_entry_index = $video_entry->safe_string(Input::get('id'));
//You can also use the video->exists method!!!
if (!$video_entry->find($video_entry_index)) {
echo "Data not found!";
} else {
$video_entry_data = $video_entry->data();
$video_entry_date_published = $video_entry_data->date_published;
$video_entry_date_exp = explode("-", $video_entry_date_published);
$video_entry_date_m = $video_entry_date_exp[1];
$video_entry_date_d = $video_entry_date_exp[2];
$video_entry_date_y = $video_entry_date_exp[0];
}
} else {
Redirect::to('../index.php');
}
}
}
?>
<!--include reg_user_header.php-->
<?php
示例3: foreach
Redirect::to('../index.php');
} else {
if (!$user->isLoggedIn() || !$user->hasPermission('admin')) {
Redirect::to('../index.php');
} else {
foreach ($_GET as $key => $value) {
if ($value == "") {
Redirect::to('../index.php');
}
}
if (Input::exists('get')) {
$video_entry = new Video();
$video_entry_id = $video_entry->safe_string(Input::get('id'));
$video_entry->find($video_entry_id);
if (!$video_entry->exists()) {
Redirect::to('../index.php');
} else {
$video_entry_title = $video_entry->data()->video_title;
try {
$video_entry->delete(['id', '=', Input::get('id')]);
Session::flash('delete', 'Video for entry "' . $video_entry_title . '" has been deleted from the database.');
Redirect::to('../index.php');
} catch (Exception $e) {
die($e->getMessage());
}
}
} else {
Redirect::to('../index.php');
}
}
}