本文整理匯總了PHP中MenuItem::getDatasets方法的典型用法代碼示例。如果您正苦於以下問題:PHP MenuItem::getDatasets方法的具體用法?PHP MenuItem::getDatasets怎麽用?PHP MenuItem::getDatasets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MenuItem
的用法示例。
在下文中一共展示了MenuItem::getDatasets方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testConstructor
/**
* Test constructor
*/
public function testConstructor()
{
$tab = new MenuItem('my_short_name', "Name of My Tab");
$this->assertEqual($tab->short_name, 'my_short_name');
$this->assertEqual($tab->name, 'Name of My Tab');
$this->assertEqual($tab->description, '');
$this->assertEqual($tab->view_template, 'inline.view.tpl');
$datasets = $tab->getDatasets();
$this->assertIsA($datasets, 'array');
$this->assertEqual(sizeof($datasets), 0);
}
示例2: testConstructor
/**
* Test constructor
*/
public function testConstructor()
{
$menu_item = new MenuItem("Name of My Menu Item");
$this->assertEqual($menu_item->name, 'Name of My Menu Item');
$this->assertEqual($menu_item->description, '');
$this->assertEqual($menu_item->view_template, 'inline.view.tpl');
$this->assertEqual($menu_item->parent, null);
$datasets = $menu_item->getDatasets();
$this->assertIsA($datasets, 'array');
$this->assertEqual(sizeof($datasets), 0);
$menu_item1 = new MenuItem("Name of My Menu Item 1", 'descriptive text', 'mytemplate.tpl', "my-parent");
$this->assertEqual($menu_item1->name, 'Name of My Menu Item 1');
$this->assertEqual($menu_item1->description, 'descriptive text');
$this->assertEqual($menu_item1->view_template, 'mytemplate.tpl');
$this->assertEqual($menu_item1->parent, "my-parent");
}