CodeIgniter Forums
Loading Assets from inside of theme folder - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Loading Assets from inside of theme folder (/thread-57026.html)

Pages: 1 2


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]Aken[/eluser]
Pyro's folder structure is different from CI's default, but everything is still under the web root. You're trying to put files that need to be accessed via HTTP outside of your web root, making them inaccessible to HTTP requests.


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]xtremer360[/eluser]
I'm sorry. I understand now. I just heard that for safety reasons to take both system and application folders out of the web root. Is there still a way I can deal with this situation still with keeping my file structure?


Loading Assets from inside of theme folder - El Forum - 02-08-2013

[eluser]Aken[/eluser]
It is a good idea to put system/application folders outside of the web root, yes. But 1) you shouldn't put static assets in your application folder to begin with, no matter where it is, and 2) you can't access static assets or anything requested over HTTP outside of your web root. So like I said, your themes -- or at minimum, their static assets -- need to be in your web root somewhere.


Loading Assets from inside of theme folder - El Forum - 02-09-2013

[eluser]xtremer360[/eluser]
I am still struggling with this situation. I can not get the line of code to run so its not echoing the code out at all. This is my login form view file.

When the page is rendered it completely by passes this line and doesn't echo it and doesn't give me an error for me to know why. Any ideas?

I have since changed my file structure so that it looks like this:

Code:
application/
    themes/
        supr/
            assets/
                js
                css
                images

<?php echo Asset::css('bootstrap/bootstrap.min.css'); ?>



Loading Assets from inside of theme folder - El Forum - 02-09-2013

[eluser]InsiteFX[/eluser]
As Aken stated your assets should be in your web root see below directory structure.
Code:
application
system
index.php
assets
-- css
-- images
-- img
-- js
-- icons
-- media

Here is a sample CodeIgniter Application that I am writing to do Bootstrap themes.
It has jQuery and cookie theme handling built-in.

Bootstrap themes

NOTE: This is a work in progress and is in a development stage, not all themes have been added yet but should help you see the structure.



Loading Assets from inside of theme folder - El Forum - 02-11-2013

[eluser]xtremer360[/eluser]
I moved the application folder into the web root and can't get that line to show. So I don't know why the line isn't getting rendered.


default.php
Code:
<?php echo Asset::css('bootstrap/bootstrap.min.css'); ?>

public_html/
    application/
        themes/
            supr/
                assets/
                    js/
                    images/
                    css/
                        bootstrap/bootstrap.min.css
                views/
                    layouts/
                        default.php



Loading Assets from inside of theme folder - El Forum - 02-11-2013

[eluser]InsiteFX[/eluser]
Code:
public_html/
application/
system/
index.php

assets/
-- css/
-- images/
-- img/
-- js/
-- themes\



Loading Assets from inside of theme folder - El Forum - 02-11-2013

[eluser]xtremer360[/eluser]
Then how can PyroCMS get away with no doing it that way.




Loading Assets from inside of theme folder - El Forum - 02-11-2013

[eluser]InsiteFX[/eluser]
Because PyroCMS was not written for these versions of CodeIgniter. The older versions before 2.0
did not have the .htaccess file in the directories to protect them.