Merge branch 'master' of github.com:yiisoft/yii2 into email-swift-2

This commit is contained in:
Paul Klimov
2013-10-28 12:25:09 +02:00
11 changed files with 95 additions and 8 deletions

View File

@@ -259,16 +259,16 @@ class View extends Component
$output = '';
if ($this->beforeRender($viewFile)) {
Yii::trace("Rendering view file: $viewFile", __METHOD__);
$ext = pathinfo($viewFile, PATHINFO_EXTENSION);
if (isset($this->renderers[$ext])) {
if (is_array($this->renderers[$ext])) {
if (is_array($this->renderers[$ext]) || is_string($this->renderers[$ext])) {
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]);
}
/** @var ViewRenderer $renderer */
$renderer = $this->renderers[$ext];
$output = $renderer->render($this, $viewFile, $params);
} else {
Yii::trace("Rendering view file: $viewFile", __METHOD__);
$output = $this->renderPhpFile($viewFile, $params);
}
$this->afterRender($viewFile, $output);

View File

@@ -17,7 +17,7 @@ use yii\helpers\Html;
*
* ```php
* // a button group with items configuration
* echo ButtonGroup::::widget([
* echo ButtonGroup::widget([
* 'buttons' => [
* ['label' => 'A'],
* ['label' => 'B'],
@@ -25,7 +25,7 @@ use yii\helpers\Html;
* ]);
*
* // button group with an item as a string
* echo ButtonGroup::::widget([
* echo ButtonGroup::widget([
* 'buttons' => [
* Button::widget(['label' => 'A']),
* ['label' => 'B'],

View File

@@ -158,7 +158,7 @@ class ActiveDataProvider extends BaseDataProvider
throw new InvalidConfigException('The "query" property must be an instance of Query or its subclass.');
}
$query = clone $this->query;
return $query->limit(-1)->offset(-1)->count('*', $this->db);
return (int) $query->limit(-1)->offset(-1)->count('*', $this->db);
}
/**

View File

@@ -88,6 +88,11 @@ class GridView extends BaseListView
* @var boolean whether to show the footer section of the grid table.
*/
public $showFooter = false;
/**
* @var string|boolean the HTML content to be displayed when [[dataProvider]] does not have any data.
* If false, the grid view will still be displayed (without body content though).
*/
public $empty = false;
/**
* @var array|Formatter the formatter used to format model attribute values into displayable texts.
* This can be either an instance of [[Formatter]] or an configuration array for creating the [[Formatter]]

View File

@@ -66,7 +66,7 @@ class FallbackMessageFormatter
* @param array $args Arguments to insert into the format string
* @return string The formatted string, or `FALSE` if an error occurred
*/
public function format(array $args)
public function format($args)
{
return static::formatMessage($this->_locale, $this->_pattern, $args);
}
@@ -79,7 +79,7 @@ class FallbackMessageFormatter
* @param array $args The array of values to insert into the format string
* @return string The formatted pattern string or `FALSE` if an error occurred
*/
public static function formatMessage($locale, $pattern, array $args)
public static function formatMessage($locale, $pattern, $args)
{
if (($tokens = static::tokenizePattern($pattern)) === false) {
return false;

View File

@@ -139,7 +139,7 @@ abstract class BaseListView extends Widget
$pageCount = $pagination->pageCount;
if (($summaryContent = $this->summary) === null) {
$summaryContent = '<div class="summary">'
. Yii::t('yii', 'Showing <b>{totalCount, plural, =0{0} other{{begin}-{end}}}</b> of <b>{totalCount}</b> {totalCount, plural, one{item} other{items}}.')
. Yii::t('yii', 'Showing <b>{totalCount, plural, =0{0} other{{begin, number, integer}-{end, number, integer}}}</b> of <b>{totalCount, number, integer}</b> {totalCount, plural, one{item} other{items}}.')
. '</div>';
}
} else {