Browse Source

'ViewContext' renamed to 'ViewContextInterface'.

tags/2.0.0-beta
Paul Klimov 11 years ago
parent
commit
e0294ea724
  1. 2
      framework/yii/base/Controller.php
  2. 4
      framework/yii/base/View.php
  3. 4
      framework/yii/base/ViewContextInterface.php
  4. 2
      framework/yii/base/Widget.php

2
framework/yii/base/Controller.php

@ -25,7 +25,7 @@ use Yii;
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0 * @since 2.0
*/ */
class Controller extends Component implements ViewContext class Controller extends Component implements ViewContextInterface
{ {
/** /**
* @event ActionEvent an event raised right before executing a controller action. * @event ActionEvent an event raised right before executing a controller action.

4
framework/yii/base/View.php

@ -89,7 +89,7 @@ class View extends Component
/** /**
* @var ViewContext the context under which the [[renderFile()]] method is being invoked. * @var ViewContextInterface the context under which the [[renderFile()]] method is being invoked.
*/ */
public $context; public $context;
/** /**
@ -244,7 +244,7 @@ class View extends Component
if ($context === null) { if ($context === null) {
$context = $this->context; $context = $this->context;
} }
if ($context instanceof ViewContext) { if ($context instanceof ViewContextInterface) {
$file = $context->findViewFile($view); $file = $context->findViewFile($view);
} else { } else {
throw new InvalidCallException('Current context is not supported.'); throw new InvalidCallException('Current context is not supported.');

4
framework/yii/base/ViewContext.php → framework/yii/base/ViewContextInterface.php

@ -8,7 +8,7 @@
namespace yii\base; namespace yii\base;
/** /**
* ViewContext represents possible context for the view rendering. * ViewContextInterface represents possible context for the view rendering.
* It determines the way the non-global view files are searched. * It determines the way the non-global view files are searched.
* This interface introduces method [[findViewFile]], which will be used * This interface introduces method [[findViewFile]], which will be used
* at [[View::render()]] to determine the file by view name, which does * at [[View::render()]] to determine the file by view name, which does
@ -19,7 +19,7 @@ namespace yii\base;
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
*/ */
interface ViewContext interface ViewContextInterface
{ {
/** /**
* Finds the view file based on the given view name. * Finds the view file based on the given view name.

2
framework/yii/base/Widget.php

@ -20,7 +20,7 @@ use Yii;
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0 * @since 2.0
*/ */
class Widget extends Component implements ViewContext class Widget extends Component implements ViewContextInterface
{ {
/** /**
* @var integer a counter used to generate [[id]] for widgets. * @var integer a counter used to generate [[id]] for widgets.

Loading…
Cancel
Save