# |
Dec 12th 2017, 13:31 |
obinoob |
hmic: refresh the table link please I've gisted the wrong file :( sorry |
# |
Dec 12th 2017, 13:31 |
jotpe |
@dereuromark yeah, but it's just used this single time, so a method would be a bit overload. |
# |
Dec 12th 2017, 13:30 |
neon1024 |
I’d use a collection instead of Hash::extract |
# |
Dec 12th 2017, 13:30 |
obinoob |
hmic: Well I'm sure it as a reason most probably doing something wrong I guess |
# |
Dec 12th 2017, 13:30 |
dereuromark |
sometimes it just easier to have a method that iterats internally over an array and returns bool result :slightly_smiling_face: |
# |
Dec 12th 2017, 13:29 |
jotpe |
why does this not work? Hash::extract($submissions, '{n}.Submission.[status_id=4]'); |
# |
Dec 12th 2017, 13:29 |
jotpe |
Hey! I want to check if a array contains a specific value with Hash::extract(). The array is 0.Submission.status_id => 4, 1.Submission.status_id => 5... |
# |
Dec 12th 2017, 13:28 |
obinoob |
hmic: not a problem ;) here my Table https://gist.github.com/obinoob/50c326b0a079861d5311d7b89e0ad83b and Controller method https://gist.github.com/obinoob/ceffa14821e7c353f6216fd9b3043539#file-clientscontroller-php-L230 |
# |
Dec 12th 2017, 13:26 |
hmic |
if you e.g. $table->find('list') it will use the primarykey as the key and the displayfield as the value in the corresponding array |
# |
Dec 12th 2017, 13:25 |
hmic |
but yes, it works this way. |
# |
Dec 12th 2017, 13:25 |
hmic |
i have mixed you up with the flash question |
# |
Dec 12th 2017, 13:25 |
hmic |
oh, sorry. |
# |
Dec 12th 2017, 13:25 |
obinoob |
hmic: hold on a bit |
# |
Dec 12th 2017, 13:25 |
obinoob |
upgraded from 3.2 $this->setDisplayField('title'); |
# |
Dec 12th 2017, 13:25 |
hmic |
how does your controller code to set the message and the template code to display it look like? |
# |
Dec 12th 2017, 13:24 |
obinoob |
3.5 |
# |
Dec 12th 2017, 13:24 |
hmic |
obinoob, which cake version? |
# |
Dec 12th 2017, 13:24 |
obinoob |
hmic: Well I had the same ideia even after reading https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html but I can't make it work :( |
# |
Dec 12th 2017, 13:19 |
hmic |
obinoob, thats the idea |
# |
Dec 12th 2017, 13:19 |
hmic |
this is for @domgeek too! |
# |
Dec 12th 2017, 13:19 |
hmic |
and it will stack the messages for you |
# |
Dec 12th 2017, 13:18 |
hmic |
neon1024: you can just call the flash method multiple times since 3.(3?) and 2.9 |
# |
Dec 12th 2017, 13:18 |
obinoob |
Hi, can I use table A setDisplayField() to replace B.A_fk? |
# |
Dec 12th 2017, 12:40 |
neon1024 |
Write them with different keys? |
# |
Dec 12th 2017, 12:39 |
domgeek |
How can I display more than one flash message on a view? |
# |
Dec 12th 2017, 12:19 |
dereuromark |
using ->with..() method for newer cake versions |
# |
Dec 12th 2017, 12:19 |
dereuromark |
most likely just writing to headers method of response as always. |
# |
Dec 12th 2017, 12:19 |
dereuromark |
well, in the end you can at least get your answers from the code there, how it is done then using the framework. |
# |
Dec 12th 2017, 12:12 |
jamesjayson |
I was trying to do this with just cake but thank you :) |
# |
Dec 12th 2017, 12:10 |
dereuromark |
see for example https://github.com/scherersoftware/cake-cktools#securitycomponent (4th link on "cakephp hsts" etc) |
# |
Dec 12th 2017, 12:10 |
dereuromark |
did you try google? if I do that I immediataly find results here |
# |
Dec 12th 2017, 12:09 |
jamesjayson |
Hello everybody, is there a cake method to set the hsts header? I can set it using php but id rather make use of the framework if possible |
# |
Dec 12th 2017, 11:57 |
ksandeep_ |
Thanks Hmic |
# |
Dec 12th 2017, 11:53 |
hmic |
and you want to change the passed arrayobject |
# |
Dec 12th 2017, 11:53 |
hmic |
or is the question originating from the fact that objects are passed by reference, arrays are not... |
# |
Dec 12th 2017, 11:52 |
hmic |
birdy247: so you convert to array when passing |
# |
Dec 12th 2017, 11:52 |
hmic |
regarding the things you are talking about later, you can easily provide data to be used in different controllers form a common place, be it a table class from the model scope, or any other custom lib, or even a component to be attached to multiple controllers easily, which is meant to solve this problem specifically |
# |
Dec 12th 2017, 11:52 |
birdy247 |
hmic answer is no |
# |
Dec 12th 2017, 11:51 |
hmic |
ksandeep_, your initial question is about accessing the request form the model scope, the answer neon1024 gave is just it: nope! |
# |
Dec 12th 2017, 11:50 |
hmic |
:P |
# |
Dec 12th 2017, 11:50 |
hmic |
!tell birdy247 about TIAS |