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


PHP Box::get方法代碼示例

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


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

示例1: boxEdit

 /**
  * Show the member edit page
  *
  * @return string Returns the member edit page as HTML code.
  */
 public function boxEdit()
 {
     if ($Box = Box::get()->byID($this->request->param('ID'))) {
         $GLOBALS['BoxID'] = $Box->ID;
     }
     return $this->customise(new ArrayData(array("Title" => _t('AdminBoxEdit.TITLE', 'AdminBoxEdit.TITLE'), "Form" => $this->BoxEditForm(), "Box" => $Box)))->renderWith(array('BoxAdmin_boxedit', 'BoxAdmin', $this->stat('template_main'), $this->stat('template')));
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:12,代碼來源:BoxAdminController.php

示例2: doAdd

 public function doAdd(array $data)
 {
     //print_r($data, true); die();
     if ($Box = Box::get()->byID($data['BoxID'])) {
         $Box->Description = $data['Description'];
         // Update Description
         $Box->write();
         $Version = new BoxVersion();
         $Version->Version = $data['Version'];
         $Version->BoxID = $Box->ID;
         $Version->write();
         $Provider = new BoxProvider();
         $Provider->Name = 'virtualbox';
         $Provider->VersionID = $Version->ID;
         $Provider->ChecksumType = 'sha1';
         $this->saveInto($Provider);
         //$Provider->write();
         $Provider->Checksum = sha1_file($Provider->File()->getFullPath());
         $Provider->write();
     } else {
         $this->sessionMessage(_t('BoxAddVersionForm.INVALIDBOX', 'BoxAddVersionForm.INVALIDBOX'), 'bad');
         return $this->controller->redirectBack();
     }
     $this->controller->redirect('cloud/index');
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:25,代碼來源:BoxAddVersionForm.php

示例3: doEdit

 public function doEdit(array $data)
 {
     if ($Box = Box::get()->byID($data['ID'])) {
         $this->saveInto($Box);
         $Box->write();
     }
     $this->controller->redirect('boxadmin/boxes');
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:8,代碼來源:BoxEditForm.php

示例4: doAdd

 public function doAdd(array $data)
 {
     if ($Box = Box::get()->filter(array("Title" => $data['Title']))->first()) {
         $this->addErrorMessage('Title', _t('BoxAddForm.TITLEEXISTS', 'BoxAddForm.TITLEEXISTS'), 'bad');
         $this->controller->redirectBack();
         return false;
     }
     $Box = Box::create();
     $this->saveInto($Box);
     $Box->write();
     $this->controller->redirect('boxadmin/boxes');
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:12,代碼來源:BoxAddForm.php

示例5: index

 /**
  * Show the "login" page
  *
  * @return string Returns the "login" page as HTML code.
  */
 public function index()
 {
     // Vorerst keine Seite erstellt
     return $this->customise(new ArrayData(array("Title" => _t('Cloud.TITLE', 'Cloud.TITLE'), "Content" => _t('Cloud.CONTENT', 'Cloud.CONTENT'), "PublicBoxes" => Box::get()->filter(array('Public' => true)), "MyBoxes" => Member::currentUser()->Boxes())))->renderWith(array('Cloud_index', 'Home', $this->stat('template_main'), $this->stat('template')));
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:10,代碼來源:CloudController.php


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