本文整理汇总了PHP中Select::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Select::get方法的具体用法?PHP Select::get怎么用?PHP Select::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Select
的用法示例。
在下文中一共展示了Select::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddOptionGroup
/**
* @covers Xoops\Form\Select::addOptionGroup
*/
public function testAddOptionGroup()
{
$groups = array('grp_key' => 'grp_name', 'grp_key1' => 'grp_name1');
$this->object->addOptionGroup('opt_grp_name', $groups);
$value = $this->object->get('option');
$this->assertTrue(is_array($value));
$this->assertSame($groups, $value['opt_grp_name']);
}
示例2: array
function edit_item($management, $pageMan)
{
$this->_template->refresh();
$pageEnt = $pageMan->getAll();
$pagesArr = array();
$itemActiveSelect = new Select('ITEM_ACTIVE');
$pagesSelect = new Select('PAGE_NAME');
$ent = $management->getItemEnt($this->_input->get('item'));
$pKey = $ent->getProperty('ITEM_NAME');
$entArr = $ent->getDataArray();
$this->_template->set_var($entArr);
for ($i = 0; $i < count($pageEnt); $i++) {
array_push($pagesArr, $pageEnt[$i]->getProperty('PAGE_NAME'));
}
$pagesSelect->addControl($pagesArr, $ent->getProperty('PAGE_NAME'));
$itemActiveSelect->addControl($this->_functions->getYNVal(), $ent->getProperty('ITEM_ACTIVE'), $this->_functions->getYNStr());
$this->_template->set_var("ITEM_PAGE_DROP", $pagesSelect->get());
$this->_template->set_var("ITEM_ACTIVE_DROP", $itemActiveSelect->get());
$this->_template->parse("EDIT_ITEM_BLOCK", "edit_item_block");
if ($this->_input->post('save')) {
foreach ($entArr as $key => $val) {
if ($key != 'ITEM_DELETED') {
$ent->setProperty($key, $this->_input->post($key));
}
}
$checkArray = array('ITEM_NAME' => 'Item name', 'ITEM_TITLE' => 'Item title');
if ($this->_jScript->checkFilds($checkArray)) {
$itemName = $this->_input->post('ITEM_NAME');
if ($management->updateEntity($ent, 'ITEM', 'ITEM_NAME', $pKey)) {
$this->details($management, $this->_input->post('menu'));
} else {
$dataArr = $ent->getDataArray();
$this->_template->set_var($dataArr);
$this->_jScript->alert('Item: ' . $itemName . ' already exist!');
}
} else {
$dataArr = $ent->getDataArray();
$this->_template->set_var($dataArr);
}
}
}
示例3: editMenu
function editMenu($management, $menuMan, $groupMan)
{
if ($this->_input->post("ALL_GROUP")) {
$menuGrEnt = $management->getMenuGroup();
$menuGrEnt->setProperty('MENU_NAME', $this->_input->get("menu"));
$menuGrEnt->setProperty('GROUPE_NAME', $this->_input->post("ALL_GROUP"));
$management->addEntity($menuGrEnt, 'GROUPE_MENU');
}
if ($this->_input->post("GROUP_SELECT")) {
$management->deleteGroupMenu($this->_input->post('GROUP_SELECT'), $this->_input->get('menu'));
}
$menuEnt = $menuMan->getEntity($this->_input->get('menu'));
$menuGrEnt = $management->getMenuGroup($this->_input->get("menu"));
$pKey = $menuEnt->getProperty('MENU_NAME');
$dataArr = $menuEnt->getDataArray();
$groupSelect = new Select('ALL_GROUP', true);
$menuGrSelect = new Select('GROUP_SELECT', true);
$groupArr = array();
$menuGrArr = array();
$groupEnt = $groupMan->getAll();
for ($i = 0; $i < count($groupEnt); $i++) {
array_push($groupArr, $groupEnt[$i]->getProperty('GROUPE_NAME'));
}
for ($i = 0; $i < count($menuGrEnt); $i++) {
array_push($menuGrArr, $menuGrEnt[$i]->getProperty('GROUPE_NAME'));
}
$groupSelect->addControl($groupArr);
$menuGrSelect->addControl($menuGrArr);
$groupSelect->ONCHANGE = "submit()";
$menuGrSelect->ONCHANGE = "submit()";
$this->_template->refresh();
$this->_template->set_var($dataArr);
$this->_template->set_var("ALL_GROUP", $groupSelect->get());
$this->_template->set_var("SELECTED_GROUP", $menuGrSelect->get());
$this->_template->parse("MENU_EDIT_BLOCK", "menu_edit_block");
}