当前位置: 首页>>代码示例>>PHP>>正文


PHP DataManager::getDocument方法代码示例

本文整理汇总了PHP中DataManager::getDocument方法的典型用法代码示例。如果您正苦于以下问题:PHP DataManager::getDocument方法的具体用法?PHP DataManager::getDocument怎么用?PHP DataManager::getDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataManager的用法示例。


在下文中一共展示了DataManager::getDocument方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 function render($name)
 {
     $dataManager = new \DataManager();
     $doc = $dataManager->getDocument($name);
     if ($doc === null) {
         $resp = new \Symfony\Component\HttpFoundation\Response("", 404);
         return $resp;
     }
     $url1 = $doc->member_one->photo_url;
     $data1 = $dataManager->getPhotoDataBase64($url1);
     $url2 = $doc->member_two->photo_url;
     $data2 = $dataManager->getPhotoDataBase64($url2);
     $url3 = $doc->vehicle->photo_url;
     $data3 = $dataManager->getPhotoDataBase64($url3);
     $imageData = base64_encode($imageContent);
     $template = new \PHPTemplate();
     $template->assign("document", $doc);
     $template->assign("member_one", $doc->member_one);
     $template->assign("member_one_photo_data_base64", $data1);
     $template->assign("member_two", $doc->member_two);
     $template->assign("member_two_photo_data_base64", $data2);
     $template->assign("home_base", $doc->home_base);
     $template->assign("completed_journeys", $doc->completed_journeys);
     $template->assign("planned_journeys", $doc->planned_journeys);
     $template->assign("wish_list_journeys", $doc->wish_list_journeys);
     $template->assign("vehicle", $doc->vehicle);
     $template->assign("vehicle_photo_data_base64", $data3);
     $h = $template->fetch('html');
     file_put_contents($name . "_html_." . "html", $h);
     return $h;
 }
开发者ID:robertblackwell,项目名称:srmn,代码行数:31,代码来源:Html.php

示例2: edit

 function edit($document_id, $section)
 {
     //        return __METHOD__." $document_id  $section ";
     $dataManager = new \DataManager();
     $doc = $dataManager->getDocument($document_id);
     $template = new \PHPTemplate();
     $template->assign("document", $doc);
     $template_name = "form_" . $section;
     return $template->fetch($template_name);
 }
开发者ID:robertblackwell,项目名称:srmn,代码行数:10,代码来源:Editor.php

示例3: show

 function show($name)
 {
     $dataManager = new \DataManager();
     $doc = $dataManager->getDocument($name);
     if ($doc === null) {
         $resp = new \Symfony\Component\HttpFoundation\Response("", 404);
         return $resp;
     }
     $template = new \PHPTemplate();
     $template->assign("document", $doc);
     return $template->fetch('show');
 }
开发者ID:robertblackwell,项目名称:srmn,代码行数:12,代码来源:Show.php

示例4: saveFile

 function saveFile(Request $request)
 {
     $dataManager = new \DataManager();
     $jsonString = "hello";
     $jsonString = $request->getContent();
     $jsonObject = json_decode($jsonString);
     $name = $jsonObject->document_name;
     $dataManager->putFile($jsonObject->document_name, $jsonObject);
     $doc = $dataManager->getDocument($name);
     if ($doc == null) {
         $resp = new \Symfony\Component\HttpFoundation\JsonResponse(['error' => ["errorCode" => "1002", "msg" => "document not found", "id" => $name, "data" => $jsonObject]], 200);
         return $resp;
     }
     return json_encode($doc);
     //        $doc = $dataManager->saveDocument($doc);
     $result = ["response" => "OK", 'reqStr' => $jsonObject];
     return json_encode($result);
 }
开发者ID:robertblackwell,项目名称:srmn,代码行数:18,代码来源:Json.php


注:本文中的DataManager::getDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。