Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually specify file to be served #329

Closed
ardoramor opened this issue Sep 13, 2015 · 0 comments
Closed

Manually specify file to be served #329

ardoramor opened this issue Sep 13, 2015 · 0 comments

Comments

@ardoramor
Copy link

I'm using Klein and doing routing manually. I also want the client to request .css files but compile for them the equivalents from .scss. It would be great for the following to work:

Custom handler.php code:

/* handler.php */
$scss = new scssc();
$server->serve(array(
   'input' => 'style.scss'
));

and the Server.php code:

/* Server.php */
,,,
public function serve($options)
    {
        $protocol = isset($_SERVER['SERVER_PROTOCOL'])
            ? $_SERVER['SERVER_PROTOCOL']
            : 'HTTP/1.0';
        if (isset($options, 'input')) {
            $input = $options['input'];
        }
        else if ($input = $options->input || $this->findInput()) {
,,,

This would basically give greater flexibility and make the server a nice utility. Right now, I have to do the following, which is hacky:

$_GET['p'] = 'style.scss';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants