vegas-cmf / core

Vegas CMF Core
MIT License
30 stars 7 forks source link

Support for theme views #23

Open raxan opened 9 years ago

raxan commented 9 years ago

Hi

I would like to ask for a new feature.

Currently is not possible override view file when create a new theme.

Will be great to have similar to wp child themes.

This allow you override certain view file, without changing core file.

For example: you put view file into a folder views/default/*

Then someone can create a new theme views/my_theme/* and override the files which want.

The system check if exist the file on my_theme otherwise load default.

Thanks!

raxan commented 9 years ago

Thanks for considering add this.

I have also already asked to phalcon team here: http://forum.phalconphp.com/discussion/2575/each-theme-custom-view-file

Someone give below workaround:

Class Phalcon\Mvc\View has a method "exists (unknown $view)", wich is not documented, but method's name doesn't offer many differents meanings. Maybe, with this method you can test if theme view file exist and if not fallback to default view ...