# |
Apr 19th 2017, 15:01 |
Neon1024 |
Two things stand out to me |
# |
Apr 19th 2017, 15:01 |
crazycoder |
Neon1024, {"controller":"Agents","action":"1","pass":["cv"],"plugin":"API","_ext":"json"} |
# |
Apr 19th 2017, 15:01 |
Neon1024 |
Also, beware of exposing auto-increment id’s in your api urls |
# |
Apr 19th 2017, 15:01 |
crazycoder |
Neon1024, https://gist.github.com/anonymous/4dc2c6942fef4025587de9198273c6f9 |
# |
Apr 19th 2017, 15:00 |
Neon1024 |
crazycoder: bin/cake routes check /api/agents/1/cv.json |
# |
Apr 19th 2017, 15:00 |
Neon1024 |
crazycoder: Route isn’t matchig the extension and is instead falling back to another route |
# |
Apr 19th 2017, 15:00 |
Neon1024 |
crazycoder: Not inside the api prefix? |
# |
Apr 19th 2017, 14:59 |
saeideng |
this routes not math with your defination |
# |
Apr 19th 2017, 14:58 |
saeideng |
see routes panel in your debug_kit |
# |
Apr 19th 2017, 14:52 |
crazycoder |
why does it take the 1 as the action name ? |
# |
Apr 19th 2017, 14:52 |
crazycoder |
with /api/agents/1/cv.json |
# |
Apr 19th 2017, 14:52 |
crazycoder |
2017-04-19 16:51:43 Error: [Cake\Controller\Exception\MissingActionException] Action AgentsController::1() could not be found, or is not accessible. |
# |
Apr 19th 2017, 14:52 |
crazycoder |
$routes->connect(':controller/:id/cv', ['controller' => 'Agents', 'action' => 'cv', 'plugin' => 'API']); |
# |
Apr 19th 2017, 14:44 |
mampel |
@dakota thank I fixed that |
# |
Apr 19th 2017, 14:41 |
saeideng |
languagae array ? |
# |
Apr 19th 2017, 13:51 |
greitas |
how to get two different languagae array in the same time? |
# |
Apr 19th 2017, 13:50 |
greitas |
hi. |
# |
Apr 19th 2017, 13:50 |
crazycoder |
hmic, thanks! |
# |
Apr 19th 2017, 13:49 |
crazycoder |
ok |
# |
Apr 19th 2017, 13:49 |
crazycoder |
awesome |
# |
Apr 19th 2017, 13:49 |
hmic |
so add it to the _hidden property and you are all good |
# |
Apr 19th 2017, 13:48 |
hmic |
check out the current implementations in the Datasource/EntityTrait, if thats the way you want/need to go |
# |
Apr 19th 2017, 13:48 |
crazycoder |
i only use it inside my controller when i have to do other jobs like saving etc |
# |
Apr 19th 2017, 13:48 |
crazycoder |
hmic, nono for json responses i do not want it |
# |
Apr 19th 2017, 13:47 |
hmic |
if you want it serialized by condition, you can overwrite the corresponding toArray() and jsonSerialize() functions in the entity to respect some custom information to decide to include the _joinData in the serialized data |
# |
Apr 19th 2017, 13:47 |
hmic |
as long as you are working with the entity, the hidden properties has no effect at all |
# |
Apr 19th 2017, 13:47 |
hmic |
it does only affect the serialized data! |
# |
Apr 19th 2017, 13:46 |
crazycoder |
i mean...if i not use $this->loadComponent('RequestHandler'); <-- does it affect other code? |
# |
Apr 19th 2017, 13:46 |
crazycoder |
does it not affect the other code? |
# |
Apr 19th 2017, 13:46 |
hmic |
as long as you do not use the serialized data, you will be fine |
# |
Apr 19th 2017, 13:46 |
crazycoder |
yes right now i am building an API so the response is in json |
# |
Apr 19th 2017, 13:45 |
crazycoder |
another component |
# |
Apr 19th 2017, 13:45 |
crazycoder |
hmic, i use it from a component |
# |
Apr 19th 2017, 13:43 |
hmic |
so your application code can use the data still. thats the whole idea |
# |
Apr 19th 2017, 13:43 |
hmic |
the hidden property is only used when serializing it |
# |
Apr 19th 2017, 13:43 |
hmic |
where do you use it? |
# |
Apr 19th 2017, 13:43 |
crazycoder |
so i cannot change it "globally" |
# |
Apr 19th 2017, 13:43 |
crazycoder |
hmic, yes i did it but sometimes i used it |
# |
Apr 19th 2017, 13:41 |
hmic |
crazycoder, why not just add _joinData to the _hidden property of the respective entity? |
# |
Apr 19th 2017, 13:41 |
inoas |
right? |
# |
Apr 19th 2017, 13:41 |
inoas |
writing a path as a key should be okay |