Difficulty with render()

25 views
Skip to first unread message

dstefani

unread,
Feb 18, 2016, 6:04:49 PM2/18/16
to The Aura Project for PHP
Hello again,

I am getting this error: Uncaught exception 'Aura\View\Exception\TemplateNotFound' with message 'call_section.php'.

I am trying to use setSection() like so:

$this->setSection('header', $this->render('call_section.php'));
echo $this->getSection('header');

And as a test, call_section.php simply has this in it: (this file is in the same folder as the layout file I'm calling it from)

echo "<h3>Products</h3>";

From the docs I'm not sure if I need to register call_section.php as a template. I've tried that and I still get the error.
I'd really like to use this, your help would be very appreciated.

Thank you,

Don

Hari K T

unread,
Feb 18, 2016, 11:42:32 PM2/18/16
to aur...@googlegroups.com
I am getting this error: Uncaught exception 'Aura\View\Exception\TemplateNotFound' with message 'call_section.php'.

I am trying to use setSection() like so:

$this->setSection('header', $this->render('call_section.php'));

Can you try with full path to the file ?

Thank you

Jake Johns

unread,
Feb 19, 2016, 5:07:49 PM2/19/16
to aur...@googlegroups.com

Depending on how that template is being registered or found, and how the template registry is configured in terms of file extension, I believe you may want to leave the extension of when calling render, no?

The 'find' method will add the default extension and end up looking for 'call_section.php.php' I believe.

--
You received this message because you are subscribed to the Google Groups "The Aura Project for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hari K T

unread,
Feb 19, 2016, 11:54:30 PM2/19/16
to aur...@googlegroups.com

Depending on how that template is being registered or found, and how the template registry is configured in terms of file extension, I believe you may want to leave the extension of when calling render, no?

The 'find' method will add the default extension and end up looking for 'call_section.php.php' I believe.

Yes Jake Johns is absolutely right.

The docs probably need to get updated.
Reply all
Reply to author
Forward
0 new messages