predominant / TwigView

Twig for CakePHP
http://cakealot.com
MIT License
78 stars 31 forks source link

"Element Not Found: Elements/xxxx.ctp" in Session.flash #16

Closed STAR-ZERO closed 11 years ago

STAR-ZERO commented 11 years ago

If you use a custom element in session.flash "Element Not Found: Elements/xxxx.ctp" occurs. I want to use the tpl extension, "Elements/xxxx.tpl".

Controller:

$this->Session->setFlash($message, 'xxxx', array());

View:

{{ _view.Session.flash() }}

I use CakePHP 2.3.x

mcreenan commented 11 years ago

For some reason, the element method in TwigView.php has a condition to change the extension to .ctp in some scenarios. I comment that out without any issues.

predominant commented 11 years ago

Thanks for that comment. I've removed the weird element rendering hack. Thats produced good results for me, let me know what you think.