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


PHP Resources::toHtml方法代碼示例

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


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

示例1: ResourcePropertyPage

 /**
  * Write the contents of the booking resources page.
  */
 function content_of_resources_page()
 {
     if (isset($_GET['editResourceId'])) {
         $rpp = new ResourcePropertyPage($_GET['editResourceId']);
         // TODO: move to ResourcePropertyPage
         // SAVE button was pressed on the edit resource property page
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $propertyIds = isset($_POST['resource_property']) ? $_POST['resource_property'] : array();
             ResourceDBO::updateResourceProperties($_GET['editResourceId'], $propertyIds);
             $rpp->isSaved = true;
         }
         error_log($rpp->toXml());
         echo $rpp->toHtml();
     } else {
         $resources = new Resources();
         try {
             // TODO: move to Resources page
             // if the user has just submitted an "Add new resource" request
             if (isset($_POST['resource_name_new']) && $_POST['resource_name_new'] != '') {
                 ResourceDBO::insertResource($_POST['resource_name_new'], $_POST['resource_capacity_new'], $_POST['resource_parent_new'] == 0 ? null : $_POST['resource_parent_new'], $_POST['resource_type_new']);
             }
         } catch (DatabaseException $de) {
             $resources->errorMessage = $de->getMessage();
         }
         echo $resources->toHtml();
     }
 }
開發者ID:narayanan-git,項目名稱:hostel-reservations,代碼行數:30,代碼來源:wp_hostel_backoffice.php

示例2: wpdev_save_resource

/**
 * Saves the selected resource row.
 */
function wpdev_save_resource()
{
    $resourceId = $_POST['resource_id'];
    $resourceName = $_POST['resource_name'];
    error_log("wpdev_save_resource {$resourceId} {$resourceName}");
    if ($resourceName != '') {
        try {
            ResourceDBO::editResource($resourceId, $resourceName);
        } catch (DatabaseException $de) {
            $msg = $de->getMessage();
        }
    }
    $resources = new Resources();
    if (isset($msg)) {
        $resources->errorMessage = $msg;
    }
    ?>
 
    <script type="text/javascript">
        document.getElementById('wpdev-bookingresources-content').innerHTML = <?php 
    echo json_encode($resources->toHtml());
    ?>
;
    </script>
    <?php 
}
開發者ID:narayanan-git,項目名稱:hostel-reservations,代碼行數:29,代碼來源:xx_wpdev-booking-ajax.php


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