本文整理汇总了PHP中KObjectConfig::toArray方法的典型用法代码示例。如果您正苦于以下问题:PHP KObjectConfig::toArray方法的具体用法?PHP KObjectConfig::toArray怎么用?PHP KObjectConfig::toArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KObjectConfig
的用法示例。
在下文中一共展示了KObjectConfig::toArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _fetchData
protected function _fetchData(KViewContext $context)
{
$state = $this->getModel()->getState();
$container = $this->getModel()->getContainer();
$config = new KObjectConfig($state->config);
$config->append(array('router' => array('defaults' => array('option' => 'com_' . substr($container->slug, 0, strpos($container->slug, '-')), 'routed' => '1')), 'initial_response' => true))->append($this->getConfig()->config);
if ($config->initial_response === true) {
$count = 0;
$query = $state->getValues();
unset($query['config']);
$query['thumbnails'] = $this->getModel()->getContainer()->getParameters()->thumbnails;
if (strpos($this->getLayout(), 'compact') !== false) {
$query['limit'] = 0;
$count = ComFilesIteratorDirectory::countNodes(array('path' => $this->getModel()->getPath()));
}
if ($count < 100) {
$controller = $this->getObject('com:files.controller.node');
$controller->getRequest()->setQuery($query);
$config->initial_response = $controller->format('json')->render();
} else {
unset($config->initial_response);
}
}
$state->config = $config->toArray();
$context->data->sitebase = trim(JURI::root(), '/');
$context->data->token = $this->getObject('user')->getSession()->getToken();
$context->data->container = $container;
$context->data->debug = KClassLoader::getInstance()->isDebug();
parent::_fetchData($context);
$context->parameters = $state->getValues();
$context->parameters->config = $config;
}
示例2: _getRoute
/**
* Convert an array to a URL
*
* @param KObjectConfig $config
* @param bool $fqr
* @param bool $escape
* @return string Routed URL
*/
protected function _getRoute(KObjectConfig $config, $fqr = false, $escape = true)
{
unset($config->entity);
return call_user_func_array($this->_router, array($config->toArray(), $fqr, $escape));
}
示例3: unbox
/**
* Return the data
*
* If the data being passed is an instance of KObjectConfig the data will be transformed to an associative array.
*
* @param mixed|KObjectConfig $data
* @return mixed|array
*/
public static function unbox($data)
{
return $data instanceof KObjectConfig ? $data->toArray() : $data;
}