本文整理汇总了PHP中JToolbar::addButtonPath方法的典型用法代码示例。如果您正苦于以下问题:PHP JToolbar::addButtonPath方法的具体用法?PHP JToolbar::addButtonPath怎么用?PHP JToolbar::addButtonPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JToolbar
的用法示例。
在下文中一共展示了JToolbar::addButtonPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddButtonPathArray
public function testAddButtonPathArray()
{
$initialValue = $this->readAttribute($this->object, '_buttonPath');
$this->object->addButtonPath(array('MyTestPath1', 'MyTestPath2'));
$newValue = $this->readAttribute($this->object, '_buttonPath');
$this->assertThat($newValue[0], $this->equalTo('MyTestPath2' . DIRECTORY_SEPARATOR));
$this->assertThat($newValue[1], $this->equalTo('MyTestPath1' . DIRECTORY_SEPARATOR));
$initialCount = count($initialValue);
for ($i = 0; $i < $initialCount; $i++) {
$this->assertThat($initialValue[$i], $this->equalTo($newValue[$i + 2]));
}
}
示例2: die
/**
* K2import entry point for K2import Component
*
* @package K2import
* @link http://www.individual-it.net
* @license GNU/GPL
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// Require the base controller
require_once JPATH_COMPONENT . DS . 'controller.php';
require_once JPATH_COMPONENT . DS . 'helper.php';
//Create a new toolbar:
jimport('joomla.html.toolbar');
$toolbar = new JToolbar('toolbar');
//Add the Jix button path & load the upload button type:
$toolbar->addButtonPath(JPATH_COMPONENT . DS . 'button');
$button =& $toolbar->loadButtonType('Upload', true);
$button =& $toolbar->loadButtonType('Export', true);
$button =& $toolbar->loadButtonType('Instructions', true);
// Require specific controller if requested
if ($controller = JRequest::getVar('controller')) {
require_once JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php';
}
// Create the controller
$classname = 'K2importController' . $controller;
$controller = new $classname();
// Perform the Request task
$controller->execute(JRequest::getVar('task'));
// Redirect if set by the controller
$controller->redirect();