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


PHP Folder::getPath方法代碼示例

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


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

示例1: moveTo

 /**
  * @param   Folder $folder The Folder into which it should be moved
  *
  * @return  Folder The domain object for further usage
  *
  * @author  Nicolas Pecher
  * @version Version 0.1, 01.05.2012
  */
 public function moveTo(Folder $folder)
 {
     $newFolder = new Folder();
     $newFolder->create($folder->getPath() . '/' . $this->getName());
     $children = $this->getContent();
     foreach ($children as $child) {
         $child->moveTo($newFolder);
     }
     $this->delete();
     $this->basePath = $folder->getPath();
     return $this;
 }
開發者ID:GeneralCrime,項目名稱:code,代碼行數:20,代碼來源:Folder.php

示例2: printFolderOptions

 /** Print folder options in select box */
 function printFolderOptions($id = 0)
 {
     global $dbi;
     if ($id == 0) {
         echo "<option value=\"0\">/</option>";
     }
     // Get subsections
     $result = $dbi->query("SELECT id FROM " . folderTableName . " WHERE parentId=" . $dbi->quote($id) . " ORDER BY name");
     if ($result->rows()) {
         for ($i = 0; list($id) = $result->fetchrow_array(); $i++) {
             $folder = new Folder($id);
             echo "<option value=\"" . $folder->id . "\"" . ($this->id == $folder->id ? " selected=\"selected\"" : "") . ">";
             echo $folder->getPath() . "/</option>";
             $this->printFolderOptions($folder->id);
         }
     }
 }
開發者ID:gkathir15,項目名稱:catmis,代碼行數:18,代碼來源:Folder.class.php

示例3: doUploadFile

 /**
  * Dateiupload-Vorgang ausführen
  */
 function doUploadFile()
 {
     //Relative Pfadangabe für Upload-Verzeichniss ermitteln
     $f = dirname($_SERVER['SCRIPT_NAME']);
     if (strlen(str_ireplace("/", "", $f)) == 0) {
         $f = "";
     } else {
         //wenn vorhanden ersten slash abschneiden
         if (substr($f, 0, 1) == "/" && strlen($f) > 0) {
             $f = substr($f, 1);
         }
         //wenn nicht vorhanden letzten slash anhängen
         if (substr($f, strlen($f) - 1 && strlen($f) > 0) != "/") {
             $f = $f . "/";
         }
     }
     //Verzeichniss erzeugen
     $folder = new Folder($_SERVER['DOCUMENT_ROOT'] . $this->getTargetPath());
     $newFileName = $folder->doUploadFile($_FILES['probe'], substr($folder->getPath(), strlen($_SERVER['DOCUMENT_ROOT'])), $this->getFilePrefix(), $this->TARGETFILENAME);
     $t = new Text("Datei " . $_FILES['probe']['name'] . " wurde hochgeladen.\n\n");
     $t->show();
     $this->insertIntoDbIfNeeded(substr($newFileName, strlen($_SERVER['DOCUMENT_ROOT'])));
     $this->doPostUpload();
 }
開發者ID:CyborgOne,項目名稱:cybihomecontrol_ui,代碼行數:27,代碼來源:ImageUploader.php


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