# |
Jul 3rd 2017, 05:17 |
loganstrob |
i want to access a url which i know will provide me wit a json data |
# |
Jul 3rd 2017, 05:15 |
savant |
is this in php or on the browser? |
# |
Jul 3rd 2017, 05:15 |
loganstrob |
soo would it help? |
# |
Jul 3rd 2017, 05:15 |
loganstrob |
i guess what i am looking for is a jsonp response |
# |
Jul 3rd 2017, 05:14 |
savant |
https://book.cakephp.org/3.0/en/core-libraries/httpclient.html |
# |
Jul 3rd 2017, 05:14 |
savant |
@loganstrob you can use the Http client |
# |
Jul 3rd 2017, 04:59 |
loganstrob |
What is the best practice for accessing an external url...which will provide me with some json data on that url and...how do i store it in an array and decode it? |
# |
Jul 3rd 2017, 04:12 |
admad |
If you use belonsToMany with 'through' option then can just specify 'conditions' in the association config |
# |
Jul 3rd 2017, 03:08 |
btx |
only way i’ve been able to get it to work is by avoiding the ‘through’ and just doing A > B < C |
# |
Jul 3rd 2017, 03:07 |
btx |
yup |
# |
Jul 3rd 2017, 03:03 |
cpierce |
are you using standard naming conventions so it knows how to join them? |
# |
Jul 3rd 2017, 02:58 |
btx |
trying to ‘contain’ the join model throws an error saying the two models aren’t associated |
# |
Jul 3rd 2017, 02:53 |
savant |
¯\_(ツ)_/¯ |
# |
Jul 3rd 2017, 02:53 |
btx |
is there a way to do an `order by` clause on a join table in a hasMany through? (ie i want the join data ordered by sequence_no ASC) |
# |
Jul 3rd 2017, 02:51 |
cpierce |
@thomasnucleus do you have insight you'd like to add |
# |
Jul 3rd 2017, 02:49 |
thomasnucleus |
Uhh not really savant :S |
# |
Jul 3rd 2017, 02:48 |
savant |
and fix them when you see them |
# |
Jul 3rd 2017, 02:48 |
savant |
turn on warnings and deprecation notices |
# |
Jul 3rd 2017, 02:47 |
cpierce |
ok i just didn't want it failing on me later on because the old code that was working is the same as the book says as "prior to 3.4.0 |
# |
Jul 3rd 2017, 02:47 |
savant |
if it breaks, it’ll yell at you |
# |
Jul 3rd 2017, 02:47 |
cpierce |
``` $response = $response->type(['pdf' => 'application/pdf']) ->withType('pdf') ->withFile($s3['cdn'] . '/' . $s3['folder'] . '/files//' . $pdf_location); return $response; ``` |
# |
Jul 3rd 2017, 02:47 |
savant |
use the same methods as befoer? |
# |
Jul 3rd 2017, 02:46 |
cpierce |
and as a work around for the text/plain i was trying |
# |
Jul 3rd 2017, 02:46 |
cpierce |
yeah i'm trying to build a downloader to count active downloads of a pdf |
# |
Jul 3rd 2017, 02:46 |
cpierce |
$this->response? |
# |
Jul 3rd 2017, 02:46 |
savant |
is there a specific instance where you need to create a custom response object? |
# |
Jul 3rd 2017, 02:46 |
savant |
@cpierce just use cakephp as you normally would |
# |
Jul 3rd 2017, 02:45 |
cpierce |
i'm not seeing anywhere in the documentation where it shows actually building a response |
# |
Jul 3rd 2017, 02:45 |
cpierce |
how do you use the new $response stuff in cakephp 3.4 and above |
# |
Jul 3rd 2017, 02:43 |
savant |
like a dummy app exhibiting this bug |
# |
Jul 3rd 2017, 02:43 |
savant |
do you have a small test case I can use to reproduce |
# |
Jul 3rd 2017, 02:43 |
savant |
nothing to do with images |
# |
Jul 3rd 2017, 02:43 |
savant |
seems like it would output javascript |
# |
Jul 3rd 2017, 02:43 |
savant |
> debug-javascript |
# |
Jul 3rd 2017, 02:42 |
thomasnucleus |
wkhtmltopdf has 'debug-javascript' => true but I can't see anything |
# |
Jul 3rd 2017, 02:42 |
savant |
i dont know if `wkhtmltopdf` has some debugging option you can set |
# |
Jul 3rd 2017, 02:41 |
savant |
if it stalls, it stalls |
# |
Jul 3rd 2017, 02:41 |
savant |
err wkhtmlpdf |
# |
Jul 3rd 2017, 02:41 |
savant |
we create an instance of dompdf with all the options you’ve set |
# |
Jul 3rd 2017, 02:40 |
thomasnucleus |
Some debugger in cakepdf? |
# |
Jul 3rd 2017, 02:40 |
thomasnucleus |
Is there a way to output the errors? |