Laravel 4: Load External View -
i'm moving codeigniter laravel 4 , haven't been able find decent way load view external application. setup 10-15 apps own laravel installation. these apps unique apps. however, use same template , don't want have 10-15 copies of same file throughout apps. so, i'm trying figure out way share template among these apps. did in codeigniter loading external view , providing path centralized location contained template file. best practice in laravel make happen?
edit: i'm not sure if did job explaining i'm trying do. basically, have blade layout file want use template of apps. i'm trying avoid having copy , paste file every installation. of these installations on same server want centralized location store blade layout file , use each app.
in laravel can set many paths views in app/conf/views.php
:
/* |-------------------------------------------------------------------------- | view storage paths |-------------------------------------------------------------------------- | | templating systems load templates disk. here may specify | array of paths should checked views. of course | usual laravel view path has been registered you. | */ 'paths' => array(__dir__.'/../views'),
you can add external path there , laravel try find views in new path.
you can this:
'paths' => array(__dir__.'/../views', '/var/www/'),
and in application use
return view::make('myotherapp/views/users/show');
and laravel find file
/var/www/myotherapp/views/users/show.php
for you.
Comments
Post a Comment