Asset_Helper For Newbie to setting up external CSS

Hello guys,
I'm newbie and i cannot find detail step by step guide how set up asset_helper until it works load my css. i used code igniter ver.1.7.2.
I downloaded the asset_helper from:

This is the settings of my codeigniter in my personal computer :
1)I build my application at http://localhost/codeigniter/
2)I have set system/application.config/config.php like this
$config['base_url'] = "http://localhost/codeigniter";
$config['index_page'] = "";

3)I have set system/application.config/routes.php like this
$route['default_controller'] = "hello";
4)I have used .htaccess placed in the root where there are placed together with some files and folders like index.php,system,user_guide and license.txt.
my content of .htaccess file is:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js\robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

5)In my CONTROLLER, i make a file hello.php
so it becomes (codeigniter\system\application\controllers\hello.php),
the code are:
class Hello extends Controller {
   function Hello ()  //Constructor
   function index()
     $data['message'] = 'This is for the html body sent from controller';
6)In my VIEWS, i make a file hello_view.php
so it becomes (codeigniter\system\application\views\hello_view.php),
the code are:

<h1> This is Body Title with External CSS placed in assets</h1>
<p>&lt;?php echo "Hello, this is made with php ",$message ?&gt; </p>

There is no CSS RESULT OF ABOVE CODE when i try in http://localhost/codeigniter/

7)I build a folder asset in the root, together with other files like .htaccess so the structure like:
Folder Structure


1)What must i setting to make my external CSS runs ?
2)what file that the code must i change to? please show me how..

Thank you guys for the help, maybe my question is so basic...
i hope many newbies can be helped through this question too.

Why no one help me :down:

[eluser]Matthieu Fauveau[/eluser]
Hi vinexar,

You are in luck 'cause I'm in an helping mood (while I wait for someone to pick me up, but that's another story).

The asset helper is only returning the HTML string. When you call : css_asset('css/style.css'), it will return the HTML link tag. You need to get that in your $data array to display it into your view.

In a nutshell :

function index()
     $data['css_asset'] = css_asset('css/style.css');
     $data['message'] = 'This is for the html body sent from controller';

&lt;?php echo (isset($css_asset)) ? $css_asset : '' ?&gt;

  <h1>This is Body Title with External CSS placed in assets</h1>  
  &lt;?php echo “Hello, this is made with php “,$message ?&gt;  

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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