本文整理汇总了PHP中Zend_Paginator::addAdapterPrefixPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Paginator::addAdapterPrefixPath方法的具体用法?PHP Zend_Paginator::addAdapterPrefixPath怎么用?PHP Zend_Paginator::addAdapterPrefixPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Paginator
的用法示例。
在下文中一共展示了Zend_Paginator::addAdapterPrefixPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param Zrt_JQuery_JqGrid_Adapter_Interface $adaptor
* @param array $options
*/
public function __construct($id, $adapter, array $options = array())
{
Zend_Paginator::addAdapterPrefixPath('Zrt_JQuery_JqGrid_Adapter', 'Zrt/JQuery/JqGrid/Adapter');
if ($adapter instanceof Zrt_JQuery_JqGrid_Adapter_Interface) {
$this->_adapter = $adapter;
} else {
throw new Zrt_JQuery_JqGrid_Exception('Zrt_JQuery_JqGrid only accepts instances of the type ' . 'Zrt_JQuery_JqGrid_Adapter_Interface');
}
$this->_id = $id;
// Set grid options, automatically set the default options
// and over-ride with user options.
$this->_setDefaultOptions();
if (isset($options)) {
if ($options instanceof Zend_Config) {
$options = $options->toArray();
}
if (!is_array($options)) {
throw new Zend_Exception('JqGrid options must be in an array or a Zend_Config object');
}
$this->setOptions($options);
}
$this->_plugins = new Zrt_JQuery_JqGrid_Plugin_Broker();
$this->_plugins->setGrid($this);
$this->_plugins->registerPlugin(new Zrt_JQuery_JqGrid_Plugin_Pager());
}
示例2: testAddsSingleAdapterPrefixPath
public function testAddsSingleAdapterPrefixPath()
{
Zend_Paginator::addAdapterPrefixPath('prefix1', 'path1');
$loader = Zend_Paginator::getAdapterLoader();
$paths = $loader->getPaths();
$this->assertArrayHasKey('prefix1_', $paths);
$this->assertEquals($paths['prefix1_'], array('path1/'));
$loader->clearPaths('prefix1');
}