dperrymorrow / Fire-Log

CodeIgniter Log Browser Spark Plugin
33 stars 8 forks source link

include('styles.css') fails in view #20

Open nateritter opened 10 years ago

nateritter commented 10 years ago

In fire_log_view.php the include('styles.css'); fails if you don't specify a specific include path to the spark's directory.

Instead, let's make this more MVC-friendly (and CI-friendly since CI takes over routing by making everything relative to the application's public index.php).

I added the following lines below line 75 in Fire_log.php

$style_dir = str_replace('/libraries', '', $view_dir);
$data[ 'styles' ] = file_get_contents($style_dir . 'styles.css');

And then change line 7 in fire_log_view.php to this:

<?php echo $styles; ?>

And voila. No path issues with including the stylesheet, and it's relative for your environment.

Cheers.