Browse Source

phpdoc

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
9f2b44fc21
  1. 14
      framework/base/ErrorHandler.php
  2. 18
      framework/base/Response.php
  3. 1
      framework/caching/DbDependency.php
  4. 2
      framework/caching/MemCache.php
  5. 2
      framework/helpers/base/VarDumper.php
  6. 1
      framework/validators/CaptchaValidator.php
  7. 16
      framework/widgets/ActiveForm.php

14
framework/base/ErrorHandler.php

@ -51,6 +51,7 @@ class ErrorHandler extends Component
/**
* Handles exception
* @param \Exception $exception
*/
public function handle($exception)
@ -64,6 +65,10 @@ class ErrorHandler extends Component
$this->renderException($exception);
}
/**
* Renders exception
* @param \Exception $exception
*/
protected function renderException($exception)
{
if ($this->errorAction !== null) {
@ -196,6 +201,10 @@ class ErrorHandler extends Component
echo '<div class="code"><pre>' . $output . '</pre></div>';
}
/**
* Renders calls stack trace
* @param array $trace
*/
public function renderTrace($trace)
{
$count = 0;
@ -233,6 +242,11 @@ class ErrorHandler extends Component
echo '</table>';
}
/**
* Converts special characters to HTML entities
* @param string $text text to encode
* @return string
*/
public function htmlEncode($text)
{
return htmlspecialchars($text, ENT_QUOTES, \Yii::$app->charset);

18
framework/base/Response.php

@ -13,27 +13,45 @@ namespace yii\base;
*/
class Response extends Component
{
/**
* Starts output buffering
*/
public function beginOutput()
{
ob_start();
ob_implicit_flush(false);
}
/**
* Returns contents of the output buffer and discards it
* @return string output buffer contents
*/
public function endOutput()
{
return ob_get_clean();
}
/**
* Returns contents of the output buffer
* @return string output buffer contents
*/
public function getOutput()
{
return ob_get_contents();
}
/**
* Discards the output buffer
*/
public function cleanOutput()
{
ob_clean();
}
/**
* Discards the output buffer
* @param boolean $all if true recursively discards all output buffers used
*/
public function removeOutput($all = true)
{
if ($all) {

1
framework/caching/DbDependency.php

@ -52,6 +52,7 @@ class DbDependency extends Dependency
/**
* Generates the data needed to determine if dependency has been changed.
* This method returns the value of the global state.
* @throws InvalidConfigException
* @return mixed the data needed to determine if dependency has been changed.
*/
protected function generateDependencyData()

2
framework/caching/MemCache.php

@ -106,7 +106,7 @@ class MemCache extends Cache
/**
* Returns the underlying memcache (or memcached) object.
* @return \Memcache|\Memcached the memcache (or memcached) object used by this cache component.
* @throws Exception if memcache or memcached extension is not loaded
* @throws InvalidConfigException if memcache or memcached extension is not loaded
*/
public function getMemcache()
{

2
framework/helpers/base/VarDumper.php

@ -64,7 +64,7 @@ class VarDumper
return self::$_output;
}
/*
/**
* @param mixed $var variable to be dumped
* @param integer $level depth level
*/

1
framework/validators/CaptchaValidator.php

@ -68,6 +68,7 @@ class CaptchaValidator extends Validator
/**
* Returns the CAPTCHA action object.
* @throws InvalidConfigException
* @return CaptchaAction the action object
*/
public function getCaptchaAction()

16
framework/widgets/ActiveForm.php

@ -39,10 +39,16 @@ class ActiveForm extends Widget
public $errorMessageClass = 'yii-error-message';
/**
* @var string the default CSS class that indicates an input has error.
* This is
*/
public $errorClass = 'yii-error';
/**
* @var string the default CSS class that indicates an input validated successfully.
*/
public $successClass = 'yii-success';
/**
* @var string the default CSS class that indicates an input is currently being validated.
*/
public $validatingClass = 'yii-validating';
/**
* @var boolean whether to enable client-side data validation. Defaults to false.
@ -127,6 +133,14 @@ class ActiveForm extends Widget
return Html::label($label, $for, $options);
}
/**
* @param string $type
* @param Model $model
* @param string $attribute
* @param array $options
*
* @return string
*/
public function input($type, $model, $attribute, $options = array())
{
$value = $this->getAttributeValue($model, $attribute);

Loading…
Cancel
Save