Refactoring code, adding error message to deprecated method (View::setLayout), and updating method references

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3858 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2006-11-11 21:05:00 +00:00
parent 26955aefda
commit 99a420c8ef
3 changed files with 11 additions and 42 deletions

View file

@ -36,7 +36,11 @@ uses('view' . DS . 'helpers' . DS . 'xml');
class RssHelper extends XmlHelper {
var $helpers = array('Html', 'Text', 'Time');
var $Html = null;
var $Time = null;
var $helpers = array('Time');
/**
* Base URL
*
@ -180,14 +184,14 @@ class RssHelper extends XmlHelper {
unset($attrib['url']);
$val = $val['url'];
}
$val = $this->Html->url($val, true);
$val = Router::url($val, true);
break;
case 'source':
if (is_array($val) && isset($val['url'])) {
$attrib['url'] = $this->Html->url($val['url'], true);
$attrib['url'] = Router::url($val['url'], true);
$val = $val['title'];
} elseif (is_array($val)) {
$attrib['url'] = $this->Html->url($val[0], true);
$attrib['url'] = Router::url($val[0], true);
$val = $val[1];
}
break;
@ -200,7 +204,7 @@ class RssHelper extends XmlHelper {
$val['type'] = mime_content_type(WWW_ROOT . $val['url']);
}
}
$val['url'] = $html->Html->url($val['url'], true);
$val['url'] = Router::url($val['url'], true);
$attrib = $val;
$val = null;
break;

View file

@ -36,42 +36,6 @@ uses('set');
*/
class XmlHelper extends AppHelper {
var $helpers = array('Html');
/**
* Base URL
*
* @access public
* @var string
*/
var $base = null;
/**
* URL to current action.
*
* @access public
* @var string
*/
var $here = null;
/**
* Parameter array.
*
* @access public
* @var array
*/
var $params = array();
/**
* Current action.
*
* @access public
* @var string
*/
var $action = null;
/**
* POSTed model data
*
* @access public
* @var array
*/
var $data = null;
/**
* Name of the current model
*
@ -254,7 +218,7 @@ class XmlHelper extends AppHelper {
$out .= $this->__composeContent($content[$keys[$i]]);
} elseif (is_array($content[$keys[$i]])) {
$attr = $child = array();
if (countdim($content[$keys[$i]]) >= 2) {
if (Set::countDim($content[$keys[$i]]) >= 2) {
} else {

View file

@ -522,6 +522,7 @@ class View extends Object {
* @deprecated
*/
function setLayout($layout) {
trigger_error('(View::setLayout) Deprecated: Use $this->layout = "..." instead', E_USER_WARNING);
$this->layout = $layout;
}
/**