• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Asset Library

In trying to find out how to have the following work. I'm using the template and asset libraries from PyroCMS to help in aiding my CI application and I’m trying to figure out how I can have the dashboard look for the images/css/js files in the file structure below as opposed to the regular assets folder in the public_html folder since those files only pertain to that theme. As far as I know the code below is what is used to render a specific css file. The theme is running smoothly but when the line below gets called it renders nothing as if there is no code line present.

I'm still trying to find out why the line isn't getting rendered. I'm still needing an idea for this.

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


Still needing help with this issue. I'm going to rephrase because I've gotten further on this.

I have added the path in my backend controller and set it and now when I open the browser for it to go find the file it says that I don't have the write permissions to view the file.

>You don't have permission to access /application/themes/supr/assets/css/bootstrap/bootstrap.css
on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
<address>Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ Server at dev.mysite Port 80</address>

Make sure you don't have an .htaccess rule blocking it somewhere.

I don't have it blocking anything. This is my htaccess. When I look inside the firebug console and expand the css file it says 404 file not found.

&lt;link href="http://dev.myurl/application/themes/supr/assets/css/bootstrap/bootstrap.css" rel="stylesheet"&gt;

However on my server I can navigate and locate the file in question.

RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond $1 !^(assets|addons)
  RewriteRule ^(.*)$ index.php/$1 [L]
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType image/x-icon "access plus 2592000 seconds"
  ExpiresByType image/jpeg "access plus 2592000 seconds"
  ExpiresByType image/png "access plus 2592000 seconds"
  ExpiresByType image/gif "access plus 2592000 seconds"
  ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
  ExpiresByType text/html "access plus 600 seconds"
  ExpiresByType application/xhtml+xml "access plus 600 seconds"

<IfModule mod_headers.c>
  <FilesMatch "\\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "max-age=2692000, public"
  <FilesMatch "\\.(css)$">
    Header set Cache-Control "max-age=2692000, public"
  <FilesMatch "\\.(js)$">
    Header set Cache-Control "max-age=216000, private"
    Header unset ETag
    Header unset Last-Modified


AddType application/x-font-ttf .ttf
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-otf .otf
AddType application/x-font-woff .woff
AddType application/vnd.ms-fontobject .svg

<FilesMatch "\.(ttf|otf|eot|woff|svg)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"


Is there an .htaccess file in your application folder, or any folder in between root and the assets file?

Did you alter the default .htaccess that comes in /application?
Having anything public in /application is not a good idea for security, which is why CI denies url access to that directory by default.

So your saying I should do something like ../assets/themes/mytheme/supr/css,images,js?

Yes. It should be at the same level your index.php is located. Not within /application or /system or any of their subfolders.

That's why the htaccess in those directories say "deny from all"...no URL access. Everything in there should ONLY be called via CI (index.php - like your controllers/etc).


The url would be something like

We told you this a long time ago. Don't mix static assets and application logic. That's why Pyro uses the addons folder.

Continuing on.

0 down vote favorite

I have a development server at dev.mysite.com and I am working with coda and git to make commits and pushes to the repo which has a developmenet branch that points to my dev domain.

The file structure as of right now is this. As of right now does anyone see anything that I should reconsider changing. I'm asking this because of having a public_html inside the dev folder or what. With this setup currently when I load dev.mysite.com it shows the index of / which shows .gitignore, .git, and public_html.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.