Welcome Guest, Not a member yet? Register   Sign In
database driven CSS?
#2

[eluser]Pascal Kriete[/eluser]
Not quite as you put it, but sure it's possible:
Code:
class Assets extends Controller {
    
    /**
     * Constructor
     *
     * @access    public
     */
    function Assets()
    {
        parent::Controller();
    }

    // --------------------------------------------------------------------
    
    /**
     * Returns css files
     *
     * @access    public
     * @param    string    css name
     */
    function css($file = '')
    {
        if ($file == '')
        {
            die('Directory Listing Not Available');
        }
        
        $query = $this->db->get_where('css_table', array('css_row' => $file), 1, 0);

        if ($query->num_rows() > 0)
        {
            header('Content-Type: text/css');
            $result = $query->row();
            echo $result->content;
            exit;
        }
        
        die('Invalid CSS File: '.$file);
    }
}

So now linking to http://www.example.com/assets/css/something will try to load 'something' from the db.


Messages In This Thread
database driven CSS? - by El Forum - 07-16-2008, 11:08 AM
database driven CSS? - by El Forum - 07-16-2008, 11:18 AM
database driven CSS? - by El Forum - 07-17-2008, 05:45 AM
database driven CSS? - by El Forum - 07-17-2008, 06:22 AM
database driven CSS? - by El Forum - 07-17-2008, 06:24 AM
database driven CSS? - by El Forum - 07-17-2008, 06:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB