Here's a proof-of-concept thingy:
class AppController extends Controller {
function render($action = null, $layout = null, $file = null) {
if ($this->viewPath != 'errors') {
$action = '../' .
$this->viewPath.'_'.($action===null?$this->action:
$action);
//$this->log($action);
//die($action);
}
return parent::render($action, $layout, $file);
}
}
This will make, for example, the 'Users' controller's action 'view'
use the template '/views/users_view.ctp'. It will affect ALL
controllers and ALL actions.
I doubt you'd want to go this far though - overriding every controller
seems a bit heavy-handed.
hth
grigri
On Nov 20, 3:10 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I have an strange client that just can't get past the fact that view
> templates are, in his words "scattered across so many locations". Is
> there a way to set up a single folder and a name convention then tell
> the view where to find the files? For examples, all user templates
> would be something like user_add.ctp, user_edit.ctp, etc.
>
> Then he could edit as necessary.
>
> I try to convince him to keep his changes to the layout but he want to
> tweek every form, etc. He is odd.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---