本文整理汇总了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')));
}
示例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');
}
示例3: doEdit
public function doEdit(array $data)
{
if ($Box = Box::get()->byID($data['ID'])) {
$this->saveInto($Box);
$Box->write();
}
$this->controller->redirect('boxadmin/boxes');
}
示例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');
}
示例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')));
}