• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lack of access to files in application/third_party/

#1
Hi, I am new to CI. In my application I am trying to use a template consists of various files (css, images, js etc.) I placed in application/third_party (to facilitate future updates).
When I open the first window, the result is incorrect because - I think - do not read CSS found in
   application/third_party/template/bootstrap/css

To connect the css, in the view I put:
PHP Code:
<link rel="stylesheet" href="<?php echo base_url() . 'application/third_party/template/bootstrap/css/bootstrap.min.css' ?>"

and in application/config/config.php:
PHP Code:
$config['base_url'] = 'http://localhost/my_application/'

Trying to view the css with Web Developer, the result is a "403 Error" (but the webserver is local and do not know whether this result is reliable).

I specify tha there is no .htaccess and I am working in local (Xampp 5.6.23 on Ubuntu 16.04 / Php 5.6.23 / CodeIgniter 3.1.0).

What can be the cause?
Suggestions?

Thank you.
Reply

#2
Your php statement is missing the semi-colon at the end.
Try this:
PHP Code:
<link rel="stylesheet" href="<?php echo base_url() . 'application/third_party/template/bootstrap/css/bootstrap.min.css';?>" /> 

If that doesn't work either, check your browser's debug window (e.g. in Internet Explorer: F12). There you can see the full link to your css file that has been generated by your page.

Btw, the most common place for css and javascript files is a folder named "assets", directly below your website's root folder.
Reply

#3
The full links to css (generated) are correct. Trying to view the css with Chrome + Web Developer, the result is a "403 Error".

I moved the template from "application/third_party/template" to "assets/template" and now it works. That's okay.

But why it does not work in "application/third_party/"?
Is there anything that prevents the css reading from here?

Thanks so much.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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