Skip to content

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

Description

@nateritter

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions