Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
View/Asset Output
  • Harro, 

    I am stuck and do not know what to do right now. We recently upgraded the framework to 1.8. We use docraptor to generate reports for our customers and we have a template just for the PDF exports. The way docraptor makes pdfs, you have to send in all your js and css inline for it to work. 

    Code used to forge the view: 

    $report = View::forge('export/template', array('content'=>$content, 'css'=>true), false); //last parameter false to turn off auto filter

     self::output('pdf', $report->render()); //From here the pdf gets rendered and put in our public files folder for later use. 

    Code to echo js:

    <?php echo Asset::js('jquery.min.js', array(), null, true); ?>

    Following output in the inline js for 1.7, first line with escape character for regex:

     n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,"") 

     Following output in the inline js for 1.8, first line with escape character:

     n.extend({expando:"jQuery"+(m+Math.random()).replace(//D/g,"") 

    Causing the rest of the jquery to be commented out. 

    Can you please tell if I have a setting I need to correct or change from 1.7 to 1.8 or is something wrong? 


    David

  • Can you show exactly how you output the inline js? 
  • I edited the Asset echo in the original post,  I forgot I change it back after an edit to see what happened with the output. Here is the part of the template we use to echo the inline js.  We used casset at first but ran into issues generating more than one report at a time.

    <?php echo Asset::js('jquery.min.js', array(), null, true);?>
    <?php echo Asset::js('bootstrap.min.js', array(), null, true); ?>
    <?php echo Asset::js('fuelux.js', array(), null, true);?>
    <?php echo Asset::js('common.js', array(), null, true);?>
  • Using the Asset class to echo needed CDNs for now, but I still would like to know what changed, or where I messed up.
  • I haven't had time to look at it, I'm travelling at the moment. Early next week I'll have some time available.

Howdy, Stranger!

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

In this Discussion