CodeIgniterのhelperを使ってCSSやJSなどのPATHを生成する
環境:
CSSとJSのディレクトリはCodeigniterのルートディレクトリに配置しています。
codeigniter_root/
|
|-application/
|
|-css/
|
|-js/
|
|-system/
|
コントローラ側の記述例
application/controller/Hoge.php
<?php class Hoge extends CI_Controller { public function __construct() { parent::__construct(); } function index(){ //helperでURL PATHを取得する $this->load->helper('url'); $this->load->view('hoge_view'); } } ?>