# |
Feb 26th 2018, 11:06 |
juanito |
perfect! |
# |
Feb 26th 2018, 11:05 |
dereuromark |
for me this is running in a cake forum board solution to parse from bbcode or plain urls into player code. |
# |
Feb 26th 2018, 11:04 |
dereuromark |
juanito: I use a helper that uses https://github.com/dereuromark/MediaEmbed wrapper |
# |
Feb 26th 2018, 11:01 |
turkles |
I would use a helper, you may not always need that full code |
# |
Feb 26th 2018, 10:56 |
juanito |
hi community ! i need to create a function that parse a db text field to replace youtube urls by html code (the player). i need to know where to put the logic. does a virtual field in entity make sense ? or an helper better ? |
# |
Feb 26th 2018, 09:31 |
turkles |
Ah, thanks |
# |
Feb 26th 2018, 09:24 |
neon1024 |
`$player = $results->firstMatch(['player_id' => 123]);` |
# |
Feb 26th 2018, 09:19 |
turkles |
Hi :slightly_smiling_face: if I have done a find()->contain('Players') how can I check if a player with id 123 was in the contained results |
# |
Feb 26th 2018, 09:14 |
neon1024 |
Morning all |
# |
Feb 26th 2018, 07:28 |
kitcat711_ |
Bonjour |
# |
Feb 25th 2018, 21:16 |
Sigfried84 |
okk |
# |
Feb 25th 2018, 21:15 |
savant |
dont remember, heading into the shower |
# |
Feb 25th 2018, 21:15 |
Sigfried84 |
in an Authorities Entity? |
# |
Feb 25th 2018, 21:14 |
Sigfried84 |
the example is not a join field...would it be like: $this->Authors->_properties['name'] ? |
# |
Feb 25th 2018, 21:12 |
Sigfried84 |
cool! thnx! bye! |
# |
Feb 25th 2018, 21:11 |
savant |
https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#customize-key-value-output <-- that |
# |
Feb 25th 2018, 21:10 |
Sigfried84 |
bye! |
# |
Feb 25th 2018, 21:10 |
Sigfried84 |
late ^_^! |
# |
Feb 25th 2018, 21:09 |
Sigfried84 |
if you're still here... |
# |
Feb 25th 2018, 21:09 |
Sigfried84 |
just one more thing...how do i concatenate them? |
# |
Feb 25th 2018, 21:08 |
savant |
no problem, night |
# |
Feb 25th 2018, 21:07 |
Sigfried84 |
Ok savant, I'll try to find out how tomorrow! Now I'm heading to bed! Thank you so much! |
# |
Feb 25th 2018, 21:05 |
savant |
good luck :slightly_smiling_face: |
# |
Feb 25th 2018, 21:05 |
savant |
find(‘list’) ^ |
# |
Feb 25th 2018, 21:05 |
savant |
https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#finding-key-value-pairs |
# |
Feb 25th 2018, 21:04 |
Sigfried84 |
i added a ->['contain' => ['Authors', 'AuthorTypes']] |
# |
Feb 25th 2018, 21:04 |
savant |
im headed into the shower, but the above shows how to use contain |
# |
Feb 25th 2018, 21:04 |
savant |
https://book.cakephp.org/3.0/en/orm/query-builder.html#loading-associations |
# |
Feb 25th 2018, 21:03 |
savant |
you’d need to `contain` the extra tables - it’s like joining - and modify the `fields` that are retrieved for that find |
# |
Feb 25th 2018, 21:03 |
Sigfried84 |
a concatenation of these fields? |
# |
Feb 25th 2018, 21:02 |
Sigfried84 |
how and make it show author.name and author_type.name? |
# |
Feb 25th 2018, 21:02 |
savant |
you’ll need to modify that find(‘list’) call to get it to show something other than the `id` as the displayField |
# |
Feb 25th 2018, 21:02 |
savant |
so the authorities dropdown is populated by the Authorities->find(list) call |
# |
Feb 25th 2018, 20:51 |
Sigfried84 |
Sorry for the delay |
# |
Feb 25th 2018, 20:50 |
Sigfried84 |
Books/add.ctp https://www.irccloud.com/pastebin/3JuAw1Mr/ |
# |
Feb 25th 2018, 20:49 |
Sigfried84 |
Books Controller https://www.irccloud.com/pastebin/QsV0ywdZ/ |
# |
Feb 25th 2018, 20:41 |
Sigfried84 |
sure...let me fix some things...i messed up something ^_^! |
# |
Feb 25th 2018, 20:33 |
savant |
can you gist the add.ctp and your BooksController.php as well |
# |
Feb 25th 2018, 20:27 |
Sigfried84 |
(illustrators table is unnecessary...) |
# |
Feb 25th 2018, 20:26 |
Sigfried84 |
https://www.irccloud.com/pastebin/LfFZynZ2/ |
# |
Feb 25th 2018, 20:23 |
savant |
just trying to get you to actually show all the information so Im not guessing at what im looking at |