Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Url Suffix Problem from Config
  • Hello, I wanted to have after every url a ".html" after. It works fine but it automaticly adds on js,css urls the ".html" aswell. So no script and styling is seeable. Anyone have an idea?
  • Can you give a code example in which that happens? Because I have a url_suffix defined here too, and no problems with assets...
  • Output:
    <!doctype html>
    <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
    <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
    <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
    <!--[if IE 9]> <html class="no-js ie9 oldie" lang="en"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Loginbereich</title> <meta name="description" content="">
    <meta name="author" content=""> <meta name="viewport" content="width=device-width,initial-scale=1"> <!-- CSS concatenated and minified via ant build script-->
    <link rel="stylesheet" href="http://rstore/assets/css/admin_login.css.html">;
    <!-- end CSS--> [removed][removed] </head> <body>
    <section id="login">
    <figure><img src="http://rstore/assets/img/admin/shp_bg.png.html"; alt="Shop ICON" /></figure>
    <h1>
    Shop Administration
    </h1>
    <form action="http://rstore/admin.html"; accept-charset="utf-8" method="post"><div><label >Benutzername:</label><input name="user" value="" type="text" id="form_user" /><br /><label >Passwort:</label><input name="pw" value="" type="password" id="form_pw" /><input name="login" value="Anmelden" type="submit" id="form_login" /></div></form>
    </section> <!--! end of #container --> [removed][removed]
    [removed]window.jQuery || [removed]('[removed]<\/script>')[removed]
    [removed][removed]
    <!-- scripts concatenated and minified via ant build script-->
    [removed][removed] [removed][removed]
    <!-- end scripts-->
    [removed] // Change UA-XXXXX-X to be your site's ID
    window._gaq = '_setAccount','UAXXXXXXXX1'],['_trackPageview'],['_trackPageLoadTime';
    Modernizr.load({
    load: ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js'
    });
    [removed]
    <!--[if lt IE 7 ]>
    [removed][removed]
    [removed]window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})[removed]
    <![endif]--> </body>
    </html> Template file:
    <!doctype html>
    <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
    <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
    <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
    <!--[if IE 9]> <html class="no-js ie9 oldie" lang="en"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Loginbereich</title>
    <meta name="description" content="">
    <meta name="author" content=""> <meta name="viewport" content="width=device-width,initial-scale=1"> <!-- CSS concatenated and minified via ant build script-->
    <link rel="stylesheet" href="<?php print Uri::create('assets/css/admin_login.css'); ?>">
    <!-- end CSS--> [removed][removed]
    </head> <body>
    <section id="login">
    <figure><img src="<?php print Uri::create('assets/img/admin/shp_bg.png'); ?>" alt="Shop ICON" /></figure>
    <h1>
    Shop Administration
    </h1>
    <?php
    print Form::open('admin'); print '<div>'; print Form::label('Benutzername:');
    print Form::input('user'); print '<br />'; print Form::label('Passwort:');
    print Form::password('pw'); print Form::submit('login','Anmelden'); print '</div>'; print $error_message; print Form::close();
    ?> </section> <!--! end of #container --> [removed][removed]
    [removed]window.jQuery || [removed]('[removed]<\/script>')[removed]
    [removed][removed]
    <!-- scripts concatenated and minified via ant build script-->
    [removed][removed]
    [removed][removed]
    <!-- end scripts-->
    [removed] // Change UA-XXXXX-X to be your site's ID
    window._gaq = '_setAccount','UAXXXXXXXX1'],['_trackPageview'],['_trackPageLoadTime';
    Modernizr.load({
    load: ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js'
    });
    [removed]
    <!--[if lt IE 7 ]>
    [removed][removed]
    [removed]window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})[removed]
    <![endif]--> </body>
    </html>
    Maybe as note: its 1.0 version and not 1.1
  • Ah, you are referring to
    Uri::create('assets/css/admin_login.css');
    

    The idea is that you use the Asset class to generate your asset code, not to use Uri::create(). And this could well be an issue in 1.0. I know I fixed this issue, but that could be after the release of 1.0.
  • Thank you, this solved my problem. Offtopic Question:
    Is there some way to add routes on runtime
    to fuel?
    For example a plugin or so which want some url's for itself.
  • Depends on what you mean by 'runtime'. If you mean adding a route in memory, then yes, that is possible through the Router::add() method. Altough not very useful, unless you do this before the Request class process the request. If you mean code that updates your config/routes.php, that is possible through the Config class. Load the routes, update them, and save them again.

Howdy, Stranger!

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

In this Discussion