1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
| <?php
class TumblesController extends TumbleAppController {
var $name = 'Tumbles';
function beforeRender() {
parent::beforeRender()
$this->_configureHelpers($this->params['action']);
}
/**
* Configures the helpers for the current action
*
* @author Jose Diaz-Gonzalez
*/
function _configureHelpers($action) {
switch ($action) {
case 'index' :
$this->helpers[] = 'Text';
$this->helpers[] = 'Time';
break;
case 'view' :
$this->helpers[] = 'HtmlCache.HtmlCache';
$this->helpers[] = 'Text';
$this->helpers[] = 'Time';
break;
case 'admin_add' :
$this->helpers[] = 'Tagging.Tagging';
$this->helpers = array_merge($this->helpers, array('Wysiwyg.Wysiwyg' => array('editor' => Configure::read('AppSettings.application.editor'))));
break;
case 'admin_preview' :
$this->helpers = array_merge($this->helpers, array('Wysiwyg.Wysiwyg' => array('editor' => Configure::read('AppSettings.application.editor'))));
break;
}
}
}
?>
|
Discussion