本文整理汇总了PHP中KHelperArray::getColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP KHelperArray::getColumn方法的具体用法?PHP KHelperArray::getColumn怎么用?PHP KHelperArray::getColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KHelperArray
的用法示例。
在下文中一共展示了KHelperArray::getColumn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUnused
/**
* Get a list of langpacks that haven't been added to the nooku languages table yet
*
* @return array
*/
public function getUnused()
{
$langs = KFactory::get('admin::com.nooku.model.languages')->getList();
$list = $this->getList();
foreach (KHelperArray::getColumn($langs->toArray(), 'iso_code') as $iso_code) {
if (isset($list[$iso_code])) {
unset($list[$iso_code]);
}
}
return $list;
}
示例2: defined
<?php
/** $Id: bar.php 567 2008-07-07 23:22:39Z mathias $ */
defined('_JEXEC') or die('Restricted access');
?>
<?php
// get the chart
@$chart->title(@text('Translation Progress'));
// Data
@$chart->set_data(@$data['MISSING']);
@$chart->bar_3D(75, @$color->get('red'), @text('Missing'), 10);
@$chart->set_data(@$data['OUTDATED']);
@$chart->bar_3D(75, @$color->get('yellow'), @text('Outdated'), 10);
@$chart->set_data(@$data['COMPLETED']);
@$chart->bar_3D(75, @$color->get('green'), @text('Completed'), 10);
@$chart->set_data(@$data['ORIGINAL']);
@$chart->bar_3D(75, @$color->get('blue'), @text('Original'), 10);
// Text
$labels = KHelperArray::getColumn(@$languages, 'name');
@$chart->set_x_labels($labels);
@$chart->set_x_legend(@$table_name ? KInflector::humanize(@$table_name) . ' ' . @text('Table') : @text('All Tables'));
// Min, max and steps
$max = KHelperMath::roundup(max(@$data['TOTAL']), -1);
@$chart->set_y_max($max);
@$chart->set_y_min(0);
@$chart->set_y_label_steps($max / 10);
@$chart->set_y_legend(@text('Items'), 14, '#000000');
示例3: _processParseRules
/**
* Parse route callback function
*
* @return array
*/
public function _processParseRules($uri)
{
$vars = parent::_processParseRules($uri);
$lang = null;
//force to empty
$nooku = KFactory::get('admin::com.nooku.model.nooku');
switch ($this->getMode()) {
case JROUTER_MODE_RAW:
$lang = $uri->getVar('lang', '');
break;
case JROUTER_MODE_SEF:
$languages = $nooku->getLanguages();
/*
* Try to find the language based on the first segment in thu URL
*/
$path = $uri->getPath();
$segments = explode('/', $path);
/*
* If no path information exist, set the language to empty
*/
if (!empty($path)) {
$alias = array_shift($segments);
$aliases = array_flip(KHelperArray::getColumn($languages, 'alias'));
$lang = isset($aliases[$alias]) ? $aliases[$alias] : null;
} else {
$lang = '';
}
/*
* Prepend the URL with the default alias and perform a re-route. If the result returns
* option information the URL is valid and we assume the request doesn't contain any
* language information, otherwise the URL did contain language information.
*/
if (is_null($lang)) {
$primary = $nooku->getPrimaryLanguage();
$url = str_replace($path, $primary->alias . '/' . $path, JURI::current());
$result = $this->parse(new JURI($url));
if (isset($result['option'])) {
$lang = '';
}
}
//Remove the language from the path
if (!empty($lang)) {
$uri->setPath(implode($segments, '/'));
}
break;
}
//Force a reload the menu
if (!empty($lang) && strtolower($lang) != strtolower($nooku->getLanguage())) {
//Set the language
$nooku->setLanguage($lang);
$menu = KFactory::get('lib.joomla.application')->getMenu();
$menu->load();
}
$this->setVar('lang', $lang);
return $vars;
}
示例4: testGetColumn
/**
* @dataProvider provideForGetColumn
*/
public function testGetColumn($expected, $array, $key)
{
$this->assertEquals($expected, KHelperArray::getColumn($array, $key));
}