Well no, the _render() method is actually the one that includes the
template, so I need to override this and parse the template.
I see now that the render() method and renderLayout() method checks
the template extension. If ctp or thtml it calls View::_render, if
not it calls $this->_render which is what I want. So I changed my
extensions to .htm and did this in SimpleView:
function __construct (&$controller)
{
parent::__construct($controller);
$this->ext = '.htm';
}
Seems to work for now. Maybe a better way if someone has an example.
-Shawn
On Mar 26, 1:35 pm, Matt Curry <[email protected]> wrote:
> I think you need a "render" method (without the underscore).
>
> -Matthttp://www.pseudocoder.com
>
> On Mar 26, 2:10 pm, AbraCadaver <[email protected]> wrote:
>
> > Trying to override _render() to make a simple template parser. Cake
> > will load my view class but doesn't use the _render() method. Below
> > is my test. My view never dies. If I add the die before the class
> > def then it does die so I know the file is being included:
>
> > app/views/simple.php
> > <?php
> > class SimpleView extends View {
>
> > function _render($___viewFn, $___dataForView, $loadHelpers = true,
> > $cached = false) {
> > die();
> > }}
>
> > ?>
>
> > app/app_controller.php
> > <?php
> > class AppController extends Controller {
>
> > var $view = 'Simple';
>
> > }
>
> > ?>
>
> > Thanks!
> > -Shawn
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---