Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Error with assets folders
  • Hi all,
    I have a question with the assets configuration. I've downloaded 1.2.1 version and I'm trying to create a simple site, but the assets folder are wrong. This is how I declare my css / img / js in my controller:
    Asset::css(array('style.css', 'form.css'), array(), 'public', false);
    Asset::js(array('jquery-1.7.2.min.js', 'smooth-scroll.js'), array(), 'public', false);
    

    And this is how I render it on my view:
    <?php print Asset::render('public'); ?>
    

    The problem is that the url of my files have two "/", like these: [url=http://127.0.0.1/project/assets//css//style.css?1345125948]http://127.0.0.1/project/assets//css//style.css?1345125948[/url]
    [url=http://127.0.0.1/project/assets//css//form.css?1345125948]http://127.0.0.1/project/assets//css//form.css?1345125948[/url]
    ...
    and so on. I've found a solution creating a config file for the assets and deleting the trailing slash at the end of the definition, like these:
    'paths' => array('assets'),
    
    'img_dir' => 'img',
    'js_dir' => 'js',
    'css_dir' => 'css',
    

    But I don't know if it is my mistake or a core bug. Thanks for all!
  • You're on Windows? This issue is fixed in 1.3/develop, you can just backport the fix by copying fuel/core/classes/asset/instance.php from 1.3/develop to your core.
  • Yeah, I'm on windows.
    Thanks for help, it works perfectly!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion