• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Javascript Helper File Messing Up CSS Formatting???

#6
[eluser]CroNiX[/eluser]
You can pass variables to your header like any other view. Those variables can be css files, js files or whatever else.
controller
Code:
$assets['css'] = array(
  'http://somesite.com/css/mycss.css',
  'http://someothersite.com/css/theircss.css'
);

$this->load->view('header', $assets);

Then in the <HEAD> of your header view,
Code:
if (count($css))
{
  echo '<style type="text/css">';
  foreach($css as $c)
  {
    echo '@import url("' . $c . '");';
  }
  echo '</style'>;
}
Same with javascript...etc.


Messages In This Thread
Javascript Helper File Messing Up CSS Formatting??? - by El Forum - 07-12-2012, 10:40 AM
Javascript Helper File Messing Up CSS Formatting??? - by El Forum - 07-12-2012, 01:47 PM
Javascript Helper File Messing Up CSS Formatting??? - by El Forum - 07-12-2012, 02:34 PM
Javascript Helper File Messing Up CSS Formatting??? - by El Forum - 07-12-2012, 02:42 PM
Javascript Helper File Messing Up CSS Formatting??? - by El Forum - 07-13-2012, 12:56 AM
Javascript Helper File Messing Up CSS Formatting??? - by El Forum - 07-13-2012, 09:17 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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