Skip to content

Commit

Permalink
Removing support for deprecated .thtml view file extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 22, 2009
1 parent 7a3a696 commit a0feb84
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions cake/libs/view/view.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -373,9 +373,6 @@ function element($name, $params = array(), $loadHelpers = false) {
if (file_exists($path . 'elements' . DS . $name . $this->ext)) { if (file_exists($path . 'elements' . DS . $name . $this->ext)) {
$file = $path . 'elements' . DS . $name . $this->ext; $file = $path . 'elements' . DS . $name . $this->ext;
break; break;
} elseif (file_exists($path . 'elements' . DS . $name . '.thtml')) {
$file = $path . 'elements' . DS . $name . '.thtml';
break;
} }
} }


Expand Down Expand Up @@ -859,8 +856,6 @@ function _getViewFileName($name = null) {
return $path . $name . $this->ext; return $path . $name . $this->ext;
} elseif (file_exists($path . $name . '.ctp')) { } elseif (file_exists($path . $name . '.ctp')) {
return $path . $name . '.ctp'; return $path . $name . '.ctp';
} elseif (file_exists($path . $name . '.thtml')) {
return $path . $name . '.thtml';
} }
} }
$defaultPath = $paths[0]; $defaultPath = $paths[0];
Expand Down Expand Up @@ -895,12 +890,11 @@ function _getLayoutFileName($name = null) {
$paths = $this->_paths(Inflector::underscore($this->plugin)); $paths = $this->_paths(Inflector::underscore($this->plugin));
$file = 'layouts' . DS . $subDir . $name; $file = 'layouts' . DS . $subDir . $name;


$exts = array($this->ext, '.ctp', '.thtml');
foreach ($paths as $path) { foreach ($paths as $path) {
foreach ($exts as $ext) { if (file_exists($path . $file . $this->ext)) {
if (file_exists($path . $file . $ext)) { return $path . $file . $this->ext;
return $path . $file . $ext; } elseif (file_exists($path . $file . '.ctp')) {
} return $path . $file . '.ctp';
} }
} }
return $this->_missingView($paths[0] . $file . $this->ext, 'missingLayout'); return $this->_missingView($paths[0] . $file . $this->ext, 'missingLayout');
Expand Down

0 comments on commit a0feb84

Please sign in to comment.