Welcome Guest, Not a member yet? Register   Sign In
Confusions about path in CI
#1

[eluser]shinokada[/eluser]
I am confused about how I can add paths to css, js etc.

I am using XAMPP on Vista.

At the moment what I do is http://127.0.0.1/my_ci/css/style.css etc.

Q1. What is a better way to do this css and js?

Q2.
However I don't know how to add require_once('mynewphp.php') in controller.

Will it automatically find mynewphp.php, even I add this in application/myclasses/ ?

Q3.
I get an error message with the following code. My ZEND files are in c:\xampp\htdocs\ci_day4\system\application\my_classes.

Could anyone give me some tips about how to add path in CI please?

Code:
ini_set('include_path',ini_get('include_path').';'.BASEPATH.'application/my_classes/');


error message
Code:
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Service/Flickr.php' (include_path='.;C:\xampp\php\pear\;C:\xampp\htdocs\ci_day4/system/application/my_classes/') in C:\xampp\htdocs\ci_day4\application\controllers\flickr.php on line 12
#2

[eluser]jedd[/eluser]
In my view:
Code:
echo "\n". link_tag('assets/stylesheets/COMMON.css');
#3

[eluser]John_Betong[/eluser]
 
Try this code just before you use require_once(...) then use a relative path to your included file:
Code:
echo '<br />' . base_url();
  echo '<br />' . site_url();
  echo '<br />' . BASEPATH;
  echo '<br />' . APPPATH;
  echo '<br />' . getcwd();




Theme © iAndrew 2016 - Forum software by © MyBB