本文整理汇总了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;
}
示例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);
}
示例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');
}
示例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);
}