本文整理匯總了PHP中Resource::get_link方法的典型用法代碼示例。如果您正苦於以下問題:PHP Resource::get_link方法的具體用法?PHP Resource::get_link怎麽用?PHP Resource::get_link使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Resource
的用法示例。
在下文中一共展示了Resource::get_link方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
<!--- Resourses viewing -->
<div role="tabpanel" class="tab-pane active" id="Resources">
<br>
<?php
$course_code = $_GET['course'];
$course_id = Course::get_id($course_code);
$resources_ids = Stuff::get_Resources_Ids($course_id);
if (!is_null($resources_ids)) {
$i = 0;
foreach ($resources_ids as $resources_id) {
if (Resource::get_type($resources_id) == "slides" || Resource::get_type($resources_id) == "book" || Resource::get_type($resources_id) == "sheet") {
$i++;
$filePDF = Resource::get_link($resources_id);
$fileName = Resource::get_name($resources_id);
$fileDisc = Resource::get_description($resources_id);
echo '<div class="col-md-4">';
echo '<div class="responsive-video">';
echo '<iframe src = "../assets/js/ViewerJS/#' . $filePDF . '" width=\'400\' height=\'300\' allowfullscreen webkitallowfullscreen></iframe>';
echo '</div>';
echo '<h3>' . $fileName . '</h3>';
echo '<p>' . $fileDisc . '</p>';
echo '</div>';
}
}
if ($i == 0) {
echo '<div class="alert alert-info" role="alert">Sorry No Resources Yet</div>';
}
} else {
示例2: foreach
</div>
</div>
<!--- Resourses viewing -->
<div role="tabpanel" class="tab-pane" id="tuts">
<br>
<?php
$course_code = $_GET['course'];
$course_id = Course::get_id($course_code);
$resources_ids = Stuff::get_Resources_Ids($course_id);
if (!is_null($resources_ids)) {
$i = 0;
foreach ($resources_ids as $resources_id) {
if (Resource::get_type($resources_id) == "video") {
$i++;
$youtubeID = Resource::get_link($resources_id);
$fileName = Resource::get_name($resources_id);
$fileDisc = Resource::get_description($resources_id);
echo '<div class="col-md-4">';
echo '<div class="responsive-video">';
echo '<iframe width="420" height="315"
src="http://www.youtube.com/embed/' . $youtubeID . '">
</iframe>';
echo '</div>';
echo '<h3>' . $fileName . '</h3>';
echo '<p>' . $fileDisc . '</p>';
echo '</div>';
}
}
if ($i == 0) {
echo '<div class="alert alert-info" role="alert">Sorry No Tutorials Yet</div>';
示例3:
<?php
include 'resource.php';
include 'deliverable.php';
echo Resource::get_link(1);
echo Deliverable::get_type(1);