本文整理匯總了PHP中JAccess::getActionsFromData方法的典型用法代碼示例。如果您正苦於以下問題:PHP JAccess::getActionsFromData方法的具體用法?PHP JAccess::getActionsFromData怎麽用?PHP JAccess::getActionsFromData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JAccess
的用法示例。
在下文中一共展示了JAccess::getActionsFromData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetActionsFromData
/**
* Tests the JAccess::getActionsFromData method.
*
* @param string $data The XML string representing the actions.
* @param string $xpath The XPath query to extract the action elements.
* @param mixed $expected The expected array of actions.
* @param string $msg The failure message.
*
* @return void
*
* @since 12.1
* @dataProvider casesGetActionsFromData
*/
public function testGetActionsFromData($data, $xpath, $expected, $msg)
{
$this->assertThat(JAccess::getActionsFromData($data, $xpath), $this->equalTo($expected), 'Line:' . __LINE__ . $msg);
}
示例2: getActionsFromData
/**
* Helper wrapper method for getActionsFromData
*
* @param string|SimpleXMLElement $data The XML string or an XML element.
* @param string $xpath An optional xpath to search for the fields.
*
* @return boolean|array False if case of error or the list of actions available.
*
* @see JAccess::getActionsFromData()
* @since 3.4
*/
public function getActionsFromData($data, $xpath = '/access/section[@name=\'component\']/')
{
return JAccess::getActionsFromData($data, $xpath);
}