当前位置: 首页>>代码示例>>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;未经允许,请勿转载。