# |
Feb 12th 2018, 20:02 |
nishantmathur62 |
What changes should i do ? |
# |
Feb 12th 2018, 20:01 |
nishantmathur62 |
Hello, I have create a Data folder outside of SRC folder in cake3, Now how can i call this data folder content? "https://mapstesting.achtunglabs.co/data/flight/5/air-india-5107.jpg" |
# |
Feb 12th 2018, 19:11 |
aro |
like if you are searching tags |
# |
Feb 12th 2018, 19:11 |
aro |
is there a way to do a search on join to a habtm and sort by descending order of the number of matches? |
# |
Feb 12th 2018, 17:19 |
louis |
Hello @admad, I'm using CakePDF with wkhtmltopdf for rendering. Have you ever experienced rendering problem with https ? |
# |
Feb 12th 2018, 16:44 |
slackebot1 |
$this->Html->image('/img/logo.png', ['url' => '/posts', 'class' => 'logo']); ?> ``` |
# |
Feb 12th 2018, 16:44 |
zwarag |
What is the best way to use a logo instead of a h1 text? Previously I had the commented code (obviously not commented back then) as my "Home" link. Now I would like to use a logo. But the logo goes not well with the resizing and I'm kinda noob with frontend. Any suggestions? ``` <!--<h1><?= $this->Html->link("DirtyDreaz", ["controller" => "posts", "action" => "index"]); ?></h1>--> <?= |
# |
Feb 12th 2018, 16:18 |
akkaweb |
File uploaded https://cakesf.slack.com/files/U0V85N6NP/F98QL911D/grouping_results_-_fixed.php / https://slack-files.com/T053DPNCM-F98QL911D-3041fb8ac4 |
# |
Feb 12th 2018, 16:18 |
akkaweb |
Darn it! Hate it when as soon as I post a question it become clear on what the answer should've been |
# |
Feb 12th 2018, 16:14 |
akkaweb |
File uploaded https://cakesf.slack.com/files/U0V85N6NP/F97SDM1U5/grouping_results.php / https://slack-files.com/T053DPNCM-F97SDM1U5-7366560abf - I am trying to return results from Database grouped by date created, but I have not been successful even after reviewing documentation and examples in the book. This is my current code which returns `created` and `count` as requested, but individually per date |
# |
Feb 12th 2018, 15:25 |
admad |
/src is for class files, config files belong under /config. |
# |
Feb 12th 2018, 15:24 |
neon1024 |
Would you opt for `config` or perhaps `src/Model/Config` maybe you’re thinking `Lib/Config` ? |
# |
Feb 12th 2018, 15:23 |
neon1024 |
If you were going to configure a database type, representing a type of object, such as a type of Content. Where would *you* out your configuration files? |
# |
Feb 12th 2018, 15:04 |
dereuromark |
hmic: I can also imagine some internal file_get_contents($url) to timeout as the default behavior of php is really bad here (long term connected) |
# |
Feb 12th 2018, 14:44 |
jameg83 |
Thanks @hmic. I’ll do that when I get home tonight. |
# |
Feb 12th 2018, 14:39 |
hmic |
the browser could become inrespsonsive if you send like 100M file with wrong header (html) which it would try to parse, instead of send to the (correct) pdf handler or download. which can easily happen with wrongly setup response/routing. so just save the generated file and see if that works. if so, it's not the pdf generation that fails but your response/routing setup |
# |
Feb 12th 2018, 14:38 |
flavius |
thx @admad @dereuromark |
# |
Feb 12th 2018, 14:37 |
hmic |
jameg83: try saving the file and check your logs (cakephp and webserver respective) |
# |
Feb 12th 2018, 14:25 |
admad |
also cake shells doesn't use the middlewares :slightly_smiling_face: |
# |
Feb 12th 2018, 14:24 |
admad |
@flavius only and error/exception generated before the before middleware error hanlder is setup will be caught by the error handler set in bootstrap |
# |
Feb 12th 2018, 14:06 |
jameg83 |
Thanks @dereuromark. I’ll have a read tonight. |
# |
Feb 12th 2018, 14:03 |
flavius |
low level issues? I currently have a `throw new \Exception('test exception');` in one of my actions and its intercepted by the middleware currently, how would i produce a low level error to test the bootstrap handlers? |
# |
Feb 12th 2018, 14:01 |
dereuromark |
@jameg83 dunno, but try to keep your local setup close to production for these reasons. My findings for pdf you can find here btw: https://www.dereuromark.de/2014/04/08/generating-pdfs-with-cakephp/ |
# |
Feb 12th 2018, 14:00 |
dereuromark |
No, they still are needed to catch low level issues |
# |
Feb 12th 2018, 14:00 |
jameg83 |
@dereuromark could that be causing the issues? I’ll just try it live. |
# |
Feb 12th 2018, 13:59 |
flavius |
quick question, in `bootstrap.php` there's the code to register application error and exception handlers, are those now rendered obsolete because of the newly implemented `ErrorHandlerMiddleware`? I'm guessing the middleware will catch errors and exceptions BEFORE the handlers (also applies for CLI?) |
# |
Feb 12th 2018, 13:37 |
dereuromark |
I would never work with localhost etc :slightly_smiling_face: Always use a proper vhost setup. Makes it closer to production and life so much easier. |
# |
Feb 12th 2018, 13:36 |
slackebot1 |
rewrite issues. I’ll try tying the url manually and doing a bit more fiddling when I get home tonight. The project is my bit on the side. Thanks for your quick reply and assistance. |
# |
Feb 12th 2018, 13:36 |
jameg83 |
@hmic I am working locally on my dev server so my urls do read http://localhost.... etc but they are absolute. I’m using the html helpers and setting the fullBase attribute true in the options. I’ve checked the output in html and checked that the ctp file opens as intended, which I’m happy with. For some reason when I run through cakepdf it hangs in the browser. Other people seems to have had various issue with image file permissions a |
# |
Feb 12th 2018, 13:23 |
hmic |
actually, i'm actually not quite sure why the engine does get the rendered html as an input string, instead of the requested url, which would make the relative path issues go away - well, sure, the other engines do not work this way, but in the wkhtmltopdf case this would be more straight forward to me... |
# |
Feb 12th 2018, 13:21 |
hmic |
try to load the generated html document without running it through wkpdftohtml, does it look correct, including all the images? - check the urls in this generated file, are they reading your correct domainname and path, *not* localhost or the like? |
# |
Feb 12th 2018, 13:20 |
hmic |
wkthtmltopdf reads a html file. this has no filesystem urls, the docs refer to the fact that you need to have *urls* for your assets that look like: http://hostname.domain/path/to/app/img/logo.jpg, instead of just img/logo.jpg |
# |
Feb 12th 2018, 13:19 |
hmic |
i think you misunderstand the "absolute path" thing here |
# |
Feb 12th 2018, 13:10 |
jameg83 |
@hmic from reading various stack overflow issues that people are having with images not displaying with cakepdf, aside from the usual absolute path issues, it seems that image file and folder permissions can cause problems. I just wanted to tap into the knowledge of more experienced users. |
# |
Feb 12th 2018, 13:00 |
hmic |
jameg83: whats your question actually?! |
# |
Feb 12th 2018, 12:32 |
jameg83 |
Does anyone have any insight into wkhtmltopdf access rights? Thanks |
# |
Feb 12th 2018, 12:28 |
flavius |
@channel |
# |
Feb 12th 2018, 12:27 |
flavius |
@everyone |
# |
Feb 12th 2018, 12:25 |
flavius |
eyyy, congrats on 300 releases of cakephp :thumbsup: |
# |
Feb 12th 2018, 11:31 |
dereuromark |
but he did |
# |
Feb 12th 2018, 11:23 |
saeideng |
@dereuromark I just want to inserting data , not truncate it :D |