Welcome Guest, Not a member yet? Register   Sign In
Asset_Helper For Newbie to setting up external CSS
#1

[eluser]Unknown[/eluser]
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:
asset_helper.zip

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:
Code:
<?php
class Hello extends Controller {
    
   function Hello ()  //Constructor
   {
     parent::Controller();
  [b]$this->load->helper('asset');[/b]        
   }
    
   function index()
   {        
   [b]css_asset('css/style.css');[/b]
        
     $data['message'] = 'This is for the html body sent from controller';
     $this->load->view('hello_view',$data);
   }
}
6)In my VIEWS, i make a file hello_view.php
so it becomes (codeigniter\system\application\views\hello_view.php),
the code are:
[code]
<html>
<head><title>Title</title>
</head>

<body>
<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>
&lt;/body&gt;
&lt;/html&gt;
/code]

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
assets/
—css/style.css
—image/
—js/

Questions:

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.


Messages In This Thread
Asset_Helper For Newbie to setting up external CSS - by El Forum - 06-09-2010, 11:03 PM
Asset_Helper For Newbie to setting up external CSS - by El Forum - 06-10-2010, 03:10 AM
Asset_Helper For Newbie to setting up external CSS - by El Forum - 06-12-2010, 01:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB