File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 33use Kris \LaravelFormBuilder \Fields \FormField ;
44use Kris \LaravelFormBuilder \Form ;
55
6+ if (!function_exists ('getFormBuilderViewPath ' ))
7+ {
8+ function getFormBuilderViewPath ($ fileName )
9+ {
10+ $ p = explode ('. ' ,$ fileName );
11+ $ c = count ($ p );
12+ if ($ c >2 || $ p [$ c -1 ]!='php ' )
13+ throw new Exception ('You should use only *.php files with this function ' );
14+
15+ $ path = base_path ('resources/views/vendor/laravel-form-builder/ ' .$ fileName );
16+ return file_exists ($ path ) ? $ path : __DIR__ .'/views/ ' .$ fileName ;
17+ }
18+ }
619
720if (!function_exists ('errorBlockPath ' ))
821{
922
1023 function errorBlockPath ()
1124 {
12- return __DIR__ . ' /views/ errors.php ' ;
25+ return getFormBuilderViewPath ( ' errors.php ') ;
1326 }
1427
1528}
@@ -19,7 +32,7 @@ function errorBlockPath()
1932
2033 function helpBlockPath ()
2134 {
22- return __DIR__ . ' /views/ help_block.php ' ;
35+ return getFormBuilderViewPath ( ' help_block.php ') ;
2336 }
2437
2538}
You can’t perform that action at this time.
0 commit comments