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


PHP Resource::get_link方法代碼示例

本文整理匯總了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 {
開發者ID:SarcasticGeek,項目名稱:College_Portal,代碼行數:28,代碼來源:resources.php

示例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>';
開發者ID:SarcasticGeek,項目名稱:College_Portal,代碼行數:31,代碼來源:tutorials.php

示例3:

<?php

include 'resource.php';
include 'deliverable.php';
echo Resource::get_link(1);
echo Deliverable::get_type(1);
開發者ID:SarcasticGeek,項目名稱:College_Portal,代碼行數:6,代碼來源:resourceController.php


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