CodeIgniter Forums
admin URL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: admin URL (/showthread.php?tid=62329)



admin URL - manoj_ci - 07-03-2015

Hii all,

I am a newbi in codeigniter. i am creating an admin panel inside application/controller/admin, application/views/admin, application/models/admin.

but it is working but i am unable to use the images & javascript path, currently i am using
<link href="<?php echo base_url(); ?>admin/css/bootstrap.css" rel="stylesheet">.

it will not link to my css.


RE: admin URL - element121 - 07-03-2015

What html does that produce when the source is viewed in the browser?

The way i use base_url() is like this:

<link href="<?php echo base_url('admin/css/bootstrap.css'); ?>" rel="stylesheet">


RE: admin URL - CroNiX - 07-03-2015

You can't have assets in the /system or /application dirs. Those aren't public dirs and are protected. Just create a new dir off your root to hold your admin assets. Here is what I typically use

/web_root
--/application
--/system (/system is usually outside of web_root)
--/assets
----/frontend
------/css
------/js
------/img
----/admin
------/css
------/js
------/img

Load a frontend asset:
<link href="<?php echo base_url('assets/frontend/css/bootstrap.css'); ?>" rel="stylesheet">

Load an admin asset:
<link href="<?php echo base_url('assets/admin/css/bootstrap.css'); ?>" rel="stylesheet">