Log message #3944187

# At Username Text
# Oct 9th 2016, 14:57 waspinator ` ########## DEBUG ########## 'img src="http://localhost/home/path/to/my/app/bin/img/logo.png" alt=""/' ########################### ` and a `########## DEBUG ########## ' ' ###########################` in th pdf
# Oct 9th 2016, 14:54 ndm Like `pre class="cake-debug">and#039;<img src=andquot;http://host/img/logo.pngandquot; alt=andquot;andquot;/>and#039;</pre`... and in the PDF it's just an empty string?
# Oct 9th 2016, 14:54 waspinator same result for both WK and Mpdf
# Oct 9th 2016, 14:54 waspinator yes
# Oct 9th 2016, 14:53 ndm @waspinator So when you look at `html()`, the generated debug output contains the expected HTML entity encoded image/link tag?
# Oct 9th 2016, 14:51 waspinator samyak, look at http://book.cakephp.org/3.0/en/development/routing.html
# Oct 9th 2016, 14:39 waspinator @ndm hmm, tried using Mpdf and got the same results. just empty strings.
# Oct 9th 2016, 14:39 samyak can you let me know how I can remove the "pages" from the URL, please
# Oct 9th 2016, 14:38 samyak HI everyone
# Oct 9th 2016, 14:37 samyak HI guys, I am building a simple CMS based on Cakephp, with categorized "posts" as in Wordpress. I can handle the admin sections where admin users will add/edit these pages. However can you guys give me directions to how to route these pages in the frontend? Ideally I dont want the pages to have "pages" in the URL and also be able to add the category slugs in the URL. something like, http://www.example.com/cakes/fruit_cake_recipe
# Oct 9th 2016, 14:08 ndm Possible... try a different engine to verify
# Oct 9th 2016, 14:06 waspinator and running `debug($CakePdf->html())` after `->write()` shows the correctly generated links. so it's a WKHTMLTOPDF thing?
# Oct 9th 2016, 14:03 waspinator same issue with images though. `debug($this->Html->image("logo.png", ['fullBase' => true]));` is an empty string in the pdf.
# Oct 9th 2016, 14:02 ndm Sounds weird... the only other circumstances I could see this happening, is when the corresponding `css` string template would be empty, or when the `block` option would magically turn to non-`null`
# Oct 9th 2016, 13:59 waspinator and `debug('hello');` outputs 'hello', so it appears that `debug` is working
# Oct 9th 2016, 13:58 waspinator no, still a empty string. If I call the same functions in a regular view I get the expected output.
# Oct 9th 2016, 13:56 ndm @waspinator Try `'once' => false` to check whether that's the cause
# Oct 9th 2016, 13:53 ndm That may be the case when the same file has already been included before... that should only apply per view instance I'd think
# Oct 9th 2016, 13:51 waspinator hmm, it looks like I can call the `Html` helper, but trying to get a link to a css file just returns an empty string. `debug($this->Html->css('bootstrap/bootstrap', ['fullBase' => true]));`
# Oct 9th 2016, 13:51 ndm * @maikh
# Oct 9th 2016, 13:48 ndm AFAIR Dompdf loads CSS files via `file_get_contents`
# Oct 9th 2016, 13:47 ndm @maik Is it possible that you have `allow_url_fopen` disabled?
# Oct 9th 2016, 13:40 maikh with this self generated css including it works. I had a ```DS``` too much on first time.
# Oct 9th 2016, 13:40 ndm @waspinator The `Html` helper should be included by default... that aside you'd either use `CakePDF::helpers()` as you've shown it, or specify a custom view class where you can load helpers. Also the core view does autoloading of helpers on the fly based on their names in case they haven't been explicitly loaded.
# Oct 9th 2016, 13:39 maikh oh... i thin it works now
# Oct 9th 2016, 13:35 waspinator I would just try on your local dev environment. if it works, then you know its something with Dompdf. If it doesn't then it's probably something else
# Oct 9th 2016, 13:34 maikh i tried is with all other supported pdfs generators. nothing.
# Oct 9th 2016, 13:34 maikh i dont want to use wkhtmltopdf beacause i dont can use this binary
# Oct 9th 2016, 13:34 waspinator can you try to change PDF renderers to test?
# Oct 9th 2016, 13:33 waspinator @maikh I'm using WKHTMLTOPDF, maybe that plays a part
# Oct 9th 2016, 13:32 maikh hm... thats very ugly... i tried it like @waspinator said... nothing.
# Oct 9th 2016, 13:32 ndm @maikh If it works there, and the CSS content is Dompdf compatible, then I'm afraid that I'm pretty much out of ideas at this point. Maybe your server responds to the CSS file request in a ways that Dompdf doesn't like, I really don't know...
# Oct 9th 2016, 13:31 waspinator for example `link rel="stylesheet" type="text/css" href="<?=WWW_ROOT . 'css' . DS . 'bootstrap' . DS . 'bootstrap.css'?>"`
# Oct 9th 2016, 13:30 waspinator without any cake helpers
# Oct 9th 2016, 13:30 waspinator I'm currently just making the links myself. and that works
# Oct 9th 2016, 13:29 waspinator on a related topic, I'm having trouble calling view helpers when generating pdfs from a shell. any ideas of how to enable those? `$CakePdf->helpers(['Html']);` doesn't work, and it looks like others have had the question as well. https://github.com/FriendsOfCake/CakePdf/issues/63
# Oct 9th 2016, 13:28 maikh @ndm yes, in tryitEditor
# Oct 9th 2016, 13:27 ndm Debugging the return value ` $CakePdf->html()` should have been enough ;) Again, have you tried that HTML in your browser?
# Oct 9th 2016, 13:24 maikh the html begins at line 1815
# Oct 9th 2016, 13:23 ndm That's what she said...
# Oct 9th 2016, 13:23 maikh @ndm its huge :slightly_smiling_face: http://pastebin.com/UEGSSckX