Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFR]: Add the has() method for View #14815

Closed
TimurFlush opened this issue Feb 5, 2020 · 1 comment
Closed

[NFR]: Add the has() method for View #14815

TimurFlush opened this issue Feb 5, 2020 · 1 comment
Labels
new feature request Planned Feature or New Feature Request

Comments

@TimurFlush
Copy link

TimurFlush commented Feb 5, 2020

Hello!

4.1.x: I propose to implement the has() method in Phalcon\Mvc\View\Simple and Phalcon\Mvc\View
5.x.x: I propose to implement the has() method in Phalcon\Mvc\ViewBaseInterface and Phalcon\Mvc\ViewInterface

In my opinion, sometimes it is important to check the existence of a template before render it.
I also checked the existence of this method in other known template engines:
Fenom : https://github.com/fenom-template/fenom/blob/fc188a582229c7735df1bb584eb268548a957f46/src/Fenom.php#L1030
Blade: https://github.com/laravel/framework/blob/d25d45b389aac2492e923a8adf885095474f8d2f/src/Illuminate/View/Factory.php#L262
Smarty: https://github.com/smarty-php/smarty/blob/4b29dfce1195b04ee337d943a9c539c8d8eb5690/libs/Smarty.class.php#L721
Twig: https://github.com/twigphp/Twig/blob/d291382a24d6c05b5126c1e1e5abeadddd82d7b2/src/Loader/FilesystemLoader.php#L145

The need to implement this method speaks for itself.

I'm waiting for your feedback.
Thanks

@TimurFlush TimurFlush added the new feature request Planned Feature or New Feature Request label Feb 5, 2020
@ruudboon
Copy link
Member

ruudboon commented Feb 5, 2020

Closing this and opening it for voting. #14608 (comment)

@ruudboon ruudboon closed this as completed Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature request Planned Feature or New Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants