I was just about to ask a similar question... :)
ricomonster said:
i wanted to create a themes folder for my mini-cms project, how can i achieve that using Laravel?
Not sure if this will work ok for you, but you can put your view directory anywhere and change it in app/config/view.php.
So you could do something like:
app/themes/boostrap or app/themes/foundation etc.
Then by changing the paths config in app/config/view.php you can swap between themes. This doesn't solve the issue of also needing to stick files in your public path.
I use themify but made some changes, move assets to theme folder Originally public/assets/theme-name/, my public/theme/assets
yes, i would like the concept that the themes will be placed under the public folder.
angelside said:
I use themify but made some changes, move assets to theme folder Originally public/assets/theme-name/, my public/theme/assets
^ will check this out if it will work.
If there will be views in your theme folder, I would not place them in the public folder. If you place them in the public folder, make sure they are not directly accessible for security reasons (opening up possible security holes).
Edwin-Luijten said:
If there will be views in your theme folder, I would not place them in the public folder. If you place them in the public folder, make sure they are not directly accessible for security reasons (opening up possible security holes).
any suggestions to make on how will i achieve this?
I have not yet tested one of these methods but you could try one from the following link: http://studentduniya.in/deny-access-of-files-and-folders-through-htaccess/
Create an htaccess file in your theme folder
<Files ~ "\blade.php$">
Order allow,deny
Deny from all
</Files>
or
Options All -Indexes
A simple solution is to namespace your views, so
add this in global.php
View::addNamespace('theme', app_path() . '/themes/views');
then save your views within your themes directory e.g
/themes/views/home/index.blade.php
and call them like so
return View::make('theme::home.index')
thanks for the responses guys, i finally solved the problem by using this package: https://github.com/harryxu/laravel-theme
Views location, solved...
But what about assets locations? Is there a mechanism to relocate the assets path from 'public' to something else?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community