# |
Jul 5th 2017, 12:06 |
popperz0r |
any1 has used epilog before? |
# |
Jul 5th 2017, 12:04 |
ldsign |
Thanks. I think thats the right hint :slightly_smiling_face: |
# |
Jul 5th 2017, 12:03 |
popperz0r |
does it looks like something wrong? |
# |
Jul 5th 2017, 12:03 |
slackebot |
->execute(); |
# |
Jul 5th 2017, 12:03 |
popperz0r |
$query = $this->CampaignLandingLayoutField->query(); $query ->insert(['campaign_id', 'landing_layout_field_id', 'value']) ->values(['campaign_id' => $campaign->id, 'landing_layout_field_id' => $field_id, 'value' => $value]) ->epilog('ON DUPLICATE KEY UPDATE value=1') |
# |
Jul 5th 2017, 12:03 |
popperz0r |
my epilog is not working |
# |
Jul 5th 2017, 12:03 |
popperz0r |
Hello |
# |
Jul 5th 2017, 12:02 |
cleptric |
I guess you could figure sth out to set it in your AppController for certain conditions |
# |
Jul 5th 2017, 12:02 |
cleptric |
https://book.cakephp.org/3.0/en/views.html#creating-your-own-view-classes |
# |
Jul 5th 2017, 12:00 |
ldsign |
So there is no way in extending the core JsonVIew and not touching my other code? |
# |
Jul 5th 2017, 11:59 |
ldsign |
Thanks. So I am forced to give every method which uses JsonView a custom viewClass? |
# |
Jul 5th 2017, 11:57 |
cleptric |
@ldsign Using you own JsonView wich inherits from JsonView and load the Helper there |
# |
Jul 5th 2017, 11:55 |
cleptric |
Yeah, this rewinds the stream to the start? Advanced php :) |
# |
Jul 5th 2017, 11:55 |
neon1024 |
Ahh, yes! Thanks chaps. I have some error text now :slightly_smiling_face: |
# |
Jul 5th 2017, 11:54 |
neon1024 |
Worth a shot! Thanks Jorge :slightly_smiling_face: |
# |
Jul 5th 2017, 11:54 |
neon1024 |
Oh you can just cast it? |
# |
Jul 5th 2017, 11:54 |
steinkel |
(string)$response->getBody() |
# |
Jul 5th 2017, 11:53 |
cleptric |
Ok, both the request and reponse `getBody()` returns a stream |
# |
Jul 5th 2017, 11:52 |
neon1024 |
So I wanted to check if I was getting an error string back to tell me more about why I’m getting a 400 |
# |
Jul 5th 2017, 11:52 |
neon1024 |
I thought it might be this, https://ecosystem.atlassian.net/browse/ACJIRA-1015 |
# |
Jul 5th 2017, 11:52 |
neon1024 |
The response from `\Cake\Http\Client::post` |
# |
Jul 5th 2017, 11:51 |
cleptric |
Wait, request or response? |
# |
Jul 5th 2017, 11:51 |
neon1024 |
Hm, okay, thanks @cleptric I guess the response is actually empty then! |
# |
Jul 5th 2017, 11:50 |
cleptric |
@neon1024 yep |
# |
Jul 5th 2017, 11:50 |
ldsign |
Hi. Do you know, how to use a custom helper in a core-viewclass? E.g. use ExtendedHtmlHelper in JsonView? |
# |
Jul 5th 2017, 11:50 |
neon1024 |
`$response->getBody()->getContents()` ? |
# |
Jul 5th 2017, 11:49 |
neon1024 |
When I try and see the content of an api request which is giving me a 400, I get steam php memory. How do I see the body content? |
# |
Jul 5th 2017, 11:46 |
juststeveking |
I know x) having one of those days |
# |
Jul 5th 2017, 11:45 |
cleptric |
No problem at all :slightly_smiling_face: Casting objects is more PHP then CakePHP ^^ |
# |
Jul 5th 2017, 11:45 |
juststeveking |
I figured it out from other code in the model |
# |
Jul 5th 2017, 11:45 |
juststeveking |
Sorry guys, relatively new to cake |
# |
Jul 5th 2017, 11:44 |
neon1024 |
gg PHP |
# |
Jul 5th 2017, 11:44 |
neon1024 |
Ah yes, it seems you can! https://3v4l.org/9TjST |
# |
Jul 5th 2017, 11:43 |
neon1024 |
I wonder what would happen |
# |
Jul 5th 2017, 11:43 |
neon1024 |
Can you cast a class to array? |
# |
Jul 5th 2017, 11:43 |
cleptric |
`$this` should be the Table when you’re calling your mail stuff in afterSave |
# |
Jul 5th 2017, 11:41 |
juststeveking |
Can I cast $this to an array to pass through to my email? |
# |
Jul 5th 2017, 11:40 |
juststeveking |
:slightly_smiling_face: thanks dde |
# |
Jul 5th 2017, 11:40 |
juststeveking |
`->viewVars()` |
# |
Jul 5th 2017, 11:36 |
cleptric |
don‘t remember the exact name right now ,:) |
# |
Jul 5th 2017, 11:36 |
cleptric |
And also something for the view vars |