diff --git a/cake/basics.php b/cake/basics.php index 0df4069e4..e58eec6e6 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -98,7 +98,7 @@ if (!function_exists('clone')) { * @param boolean $var Variable to show debug information for. * @param boolean $showHtml If set to true, the method prints the debug data in a screen-friendly way. * @param boolean $showFrom If set to true, the method prints from where the function was called. - * @link http://book.cakephp.org/view/458/Basic-Debugging + * @link http://book.cakephp.org/view/1190/Basic-Debugging */ function debug($var = false, $showHtml = false, $showFrom = true) { if (Configure::read() > 0) { @@ -198,7 +198,7 @@ if (!function_exists('array_combine')) { * @param string $text Text to wrap through htmlspecialchars * @param string $charset Character set to use when escaping. Defaults to config value in 'App.encoding' or 'UTF-8' * @return string Wrapped text - * @link http://book.cakephp.org/view/703/h + * @link http://book.cakephp.org/view/1132/h */ function h($text, $charset = null) { if (is_array($text)) { @@ -253,7 +253,7 @@ if (!function_exists('array_combine')) { * `array('a', 'b')` * * @return array Array of given parameters - * @link http://book.cakephp.org/view/694/a + * @link http://book.cakephp.org/view/1122/a * @deprecated Will be removed in 2.0 */ function a() { @@ -273,7 +273,7 @@ if (!function_exists('array_combine')) { * `array('a'=>'b')` * * @return array Associative array - * @link http://book.cakephp.org/view/695/aa + * @link http://book.cakephp.org/view/1123/aa * @deprecated Will be removed in 2.0 */ function aa() { @@ -294,7 +294,7 @@ if (!function_exists('array_combine')) { * Convenience method for echo(). * * @param string $text String to echo - * @link http://book.cakephp.org/view/700/e + * @link http://book.cakephp.org/view/1129/e * @deprecated Will be removed in 2.0 */ function e($text) { @@ -306,7 +306,7 @@ if (!function_exists('array_combine')) { * * @param string $str String to lowercase * @return string Lowercased string - * @link http://book.cakephp.org/view/705/low + * @link http://book.cakephp.org/view/1134/low * @deprecated Will be removed in 2.0 */ function low($str) { @@ -318,7 +318,7 @@ if (!function_exists('array_combine')) { * * @param string $str String to uppercase * @return string Uppercased string - * @link http://book.cakephp.org/view/710/up + * @link http://book.cakephp.org/view/1139/up * @deprecated Will be removed in 2.0 */ function up($str) { @@ -332,7 +332,7 @@ if (!function_exists('array_combine')) { * @param string $replace String to insert * @param string $subject String to search * @return string Replaced string - * @link http://book.cakephp.org/view/708/r + * @link http://book.cakephp.org/view/1137/r * @deprecated Will be removed in 2.0 */ function r($search, $replace, $subject) { @@ -345,7 +345,7 @@ if (!function_exists('array_combine')) { * * @see debug() * @param array $var Variable to print out - * @link http://book.cakephp.org/view/707/pr + * @link http://book.cakephp.org/view/1136/pr */ function pr($var) { if (Configure::read() > 0) { @@ -380,7 +380,7 @@ if (!function_exists('array_combine')) { * @param array Third array * @param array Etc... * @return array All array parameters merged into one - * @link http://book.cakephp.org/view/696/am + * @link http://book.cakephp.org/view/1124/am */ function am() { $r = array(); @@ -402,7 +402,7 @@ if (!function_exists('array_combine')) { * * @param string $key Environment variable name. * @return string Environment variable setting. - * @link http://book.cakephp.org/view/701/env + * @link http://book.cakephp.org/view/1130/env */ function env($key) { if ($key == 'HTTPS') { @@ -619,7 +619,7 @@ if (!function_exists('file_put_contents')) { * * @param array $values Array of values to strip slashes * @return mixed What is returned from calling stripslashes - * @link http://book.cakephp.org/view/709/stripslashes_deep + * @link http://book.cakephp.org/view/1138/stripslashes_deep */ function stripslashes_deep($values) { if (is_array($values)) { @@ -638,7 +638,7 @@ if (!function_exists('file_put_contents')) { * @param string $singular Text to translate * @param boolean $return Set to true to return translated string, or false to echo * @return mixed translated string if $return is false string will be echoed - * @link http://book.cakephp.org/view/693/__ + * @link http://book.cakephp.org/view/1121/__ */ function __($singular, $return = false) { if (!$singular) { @@ -919,7 +919,7 @@ if (!function_exists('file_put_contents')) { * * @param string $file File to look for * @return Full path to file if exists, otherwise false - * @link http://book.cakephp.org/view/702/fileExistsInPath + * @link http://book.cakephp.org/view/1131/fileExistsInPath */ function fileExistsInPath($file) { $paths = explode(PATH_SEPARATOR, ini_get('include_path')); @@ -940,7 +940,7 @@ if (!function_exists('file_put_contents')) { * * @param string String to convert * @return string with underscore remove from start and end of string - * @link http://book.cakephp.org/view/697/convertSlash + * @link http://book.cakephp.org/view/1126/convertSlash */ function convertSlash($string) { $string = trim($string, '/'); @@ -1001,7 +1001,7 @@ if (!function_exists('file_put_contents')) { * @param mixed $val1 Value to return in case condition matches * @param mixed $val2 Value to return if condition doesn't match * @return mixed $val1 or $val2, depending on whether $condition evaluates to a non-empty expression. - * @link http://book.cakephp.org/view/704/ife + * @link http://book.cakephp.org/view/1133/ife * @deprecated Will be removed in 2.0 */ function ife($condition, $val1 = null, $val2 = null) { diff --git a/cake/dispatcher.php b/cake/dispatcher.php index f3edc7050..d04826593 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -82,7 +82,8 @@ class Dispatcher extends Object { } /** - * Dispatches and invokes given URL, handing over control to the involved controllers, and then renders the results (if autoRender is set). + * Dispatches and invokes given URL, handing over control to the involved controllers, and then renders the + * results (if autoRender is set). * * If no controller of given name can be found, invoke() shows error messages in * the form of Missing Controllers information. It does the same with Actions (methods of Controllers are called @@ -171,8 +172,9 @@ class Dispatcher extends Object { } /** - * Invokes given controller's render action if autoRender option is set. Otherwise the - * contents of the operation are returned as a string. + * Initializes the components and models a controller will be using. + * Triggers the controller action, and invokes the rendering if Controller::$autoRender is true and echo's the output. + * Otherwise the return value of the controller action are returned. * * @param object $controller Controller to invoke * @param array $params Parameters with at least the 'action' to invoke @@ -216,10 +218,11 @@ class Dispatcher extends Object { /** * Sets the params when $url is passed as an array to Object::requestAction(); + * Merges the $url and $additionalParams and creates a string url. * - * @param array $url - * @param array $additionalParams - * @return string $url + * @param array $url Array or request parameters + * @param array $additionalParams Array of additional parameters. + * @return string $url The generated url string. * @access private */ function __extractParams($url, $additionalParams = array()) { @@ -414,7 +417,10 @@ class Dispatcher extends Object { $name = $ctrlClass; $ctrlClass .= 'Controller'; if (class_exists($ctrlClass)) { - if (empty($params['plugin']) && strtolower(get_parent_class($ctrlClass)) === strtolower($name . 'AppController')) { + if ( + empty($params['plugin']) && + strtolower(get_parent_class($ctrlClass)) === strtolower($name . 'AppController') + ) { $params = $this->_restructureParams($params); } $this->params = $params; @@ -424,7 +430,7 @@ class Dispatcher extends Object { } /** - * Load controller and return controller class + * Load controller and return controller classname * * @param array $params Array of parameters * @return string|bool Name of controller class name @@ -580,7 +586,6 @@ class Dispatcher extends Object { return $return; } } - return false; } diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index b76b9f050..f2cfcce9c 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -32,7 +32,7 @@ App::import('View', 'View', false); * * @package cake * @subpackage cake.cake.libs.controller - * @link http://book.cakephp.org/view/49/Controllers + * @link http://book.cakephp.org/view/956/Introduction */ class Controller extends Object { @@ -41,7 +41,7 @@ class Controller extends Object { * * @var string * @access public - * @link http://book.cakephp.org/view/52/name + * @link http://book.cakephp.org/view/959/Controller-Attributes */ var $name = null; @@ -72,14 +72,14 @@ class Controller extends Object { /** * An array containing the class names of models this controller uses. * - * Example: var $uses = array('Product', 'Post', 'Comment'); + * Example: `var $uses = array('Product', 'Post', 'Comment');` * * Can be set to array() to use no models. Can be set to false to * use no models and prevent the merging of $uses with AppController * * @var mixed A single name as a string or a list of names as an array. * @access protected - * @link http://book.cakephp.org/view/53/components-helpers-and-uses + * @link http://book.cakephp.org/view/961/components-helpers-and-uses */ var $uses = false; @@ -87,11 +87,11 @@ class Controller extends Object { * An array containing the names of helpers this controller uses. The array elements should * not contain the "Helper" part of the classname. * - * Example: var $helpers = array('Html', 'Javascript', 'Time', 'Ajax'); + * Example: `var $helpers = array('Html', 'Javascript', 'Time', 'Ajax');` * * @var mixed A single name as a string or a list of names as an array. * @access protected - * @link http://book.cakephp.org/view/53/components-helpers-and-uses + * @link http://book.cakephp.org/view/961/components-helpers-and-uses */ var $helpers = array('Session', 'Html', 'Form'); @@ -101,13 +101,13 @@ class Controller extends Object { * * @var array * @access public - * @link http://book.cakephp.org/view/55/The-Parameters-Attribute-params + * @link http://book.cakephp.org/view/963/The-Parameters-Attribute-params */ var $params = array(); /** * Data POSTed to the controller using the HtmlHelper. Data here is accessible - * using the $this->data['ModelName']['fieldName'] pattern. + * using the `$this->data['ModelName']['fieldName']` pattern. * * @var array * @access public @@ -122,14 +122,16 @@ class Controller extends Object { * Pagination defaults can also be supplied in a model-by-model basis by using * the name of the model as a key for a pagination array: * + * {{{ * var $paginate = array( * 'Post' => array(...), * 'Comment' => array(...) * ); + * }}} * * @var array * @access public - * @link http://book.cakephp.org/view/164/Pagination + * @link http://book.cakephp.org/view/1231/Pagination */ var $paginate = array('limit' => 20, 'page' => 1); @@ -157,16 +159,6 @@ class Controller extends Object { */ var $viewVars = array(); -/** - * Text to be used for the $title_for_layout layout variable (usually - * placed inside