# |
Dec 20th 2019, 19:04 |
dsar |
If you don't redirect in your action, POST will be kept in various http requests |
# |
Dec 20th 2019, 19:04 |
japerlman |
I guess I could just do hidden form objects |
# |
Dec 20th 2019, 19:03 |
japerlman |
will my POST data still be in $this->request->data? |
# |
Dec 20th 2019, 19:03 |
japerlman |
I'm using the cakepdf plugin, so I think I need it on the url |
# |
Dec 20th 2019, 18:55 |
dsar |
Or do you need it in the url? |
# |
Dec 20th 2019, 18:53 |
dsar |
`// View` `<?= $this->Form->button(__('Download PDF'), ['name' => 'action', 'value' => 'downloadpdf']) ?>` `// Controller` `if ($this->request->getData('action') === 'downloadpdf') {` `// ...` `}` |
# |
Dec 20th 2019, 18:51 |
dsar |
Just set a name with a value in that submit button and do the stuff in the action |
# |
Dec 20th 2019, 18:45 |
japerlman |
I have a report that generates from POST data, I want the report to render in the view and then in the view have a button that will call the same url but with .pdf at the end of the url to download a PDF of the report. Is there a good ay to do this or should I store my values in a session variable or some other way? |
# |
Dec 20th 2019, 17:24 |
felipe.marinho |
:,) awesome lists |
# |
Dec 20th 2019, 17:23 |
dereuromark |
Awesome, not amazing, but yeah :P |
# |
Dec 20th 2019, 17:22 |
felipe.marinho |
Amazing @dereuromark, just amazing. Thank you. I'll put this list in my main page lol |
# |
Dec 20th 2019, 17:20 |
dereuromark |
@felipe.marinho Did you check this list? :) https://github.com/FriendsOfCake/awesome-cakephp#orm-and-datamapping keyword "row" i would assume |
# |
Dec 20th 2019, 17:19 |
neon1024 |
I’m sure there are better solutions out there though for concurrency |
# |
Dec 20th 2019, 17:19 |
neon1024 |
Then in the afterSave, I’d set it back to `null`. Sure lots of extra IO on the DB, but you’d be certain |
# |
Dec 20th 2019, 17:18 |
neon1024 |
Then if I tried to access it again, I could check and set `$this->Flash->error('Sorry this record is being edited by ' . $user->get('username'))` |
# |
Dec 20th 2019, 17:18 |
neon1024 |
I’d write a locked_by_id to the record when someone loaded it |
# |
Dec 20th 2019, 17:15 |
felipe.marinho |
My friends, what is the correct way to avoid 2 users editing and overwriting the same entity? |
# |
Dec 20th 2019, 15:42 |
slackebot |
Painful. |
# |
Dec 20th 2019, 15:42 |
noel |
Yeah.. I think I found it – it's something weird... basically you know you get the circle icon when you're in device mode for simulating touch and drag etc... well that wasn't appearing.. just the usual arrow instead. I have to switch out of device mode and then back in again before the circle icon will appear. Once the circle icon is there then the event will trigger when I click.. if instead it's just the normal pointer then it won't. |
# |
Dec 20th 2019, 15:41 |
jimbo2150 |
Mobile devices use touch events, `$this->Html->link('<q-icon name="visibility" />', '#', ['escape' => false, 'onclick' => 'edit(event)', 'ontouchend' => 'edit(event)'])` should work. |
# |
Dec 20th 2019, 15:37 |
jotpe |
And the script is rendered properly in the Html Output? |
# |
Dec 20th 2019, 15:24 |
slackebot |
?>"; } <?php $this->Html->scriptEnd(); ``` |
# |
Dec 20th 2019, 15:24 |
noel |
Here's the link: ```$this->Html->link('<q-icon name="visibility" />', '#', ['escape' => false, 'onclick' => 'edit(event)'])``` Here's the script, which is rendered at the bottom of the template: ```<?php $this->Html->scriptStart(['block' => 'vue-component', 'type' => 'text/javascript']); ?> function edit(event) { event.stopPropagation(); window.top.location.href = "<?= Configure::read('deviceUrl').'/enquiry/'.$enquiry->id |
# |
Dec 20th 2019, 15:23 |
noel |
Something weird happening for me. I have a link rendered by the HTML helper with an onclick event. The onclick triggers fine on desktop but not on a device nor device emulator (not even the Chrome standard emulator). Any ideas? |
# |
Dec 20th 2019, 14:34 |
dsar |
A resolver is enough, the authentication plugin has already all the middlewares you need for the authentication management |
# |
Dec 20th 2019, 14:34 |
Naino |
Hi, I would like to sort a query with a belongsToMany association by join table column, is it possible to achieve that with query builder? |
# |
Dec 20th 2019, 14:30 |
luke |
I want to use fusionauth to provide login functionality. I think I need to start with middleware, but will need a resolver |
# |
Dec 20th 2019, 14:30 |
luke |
hmm, thanks, good point |
# |
Dec 20th 2019, 14:21 |
dsar |
The main logic is in the find() method |
# |
Dec 20th 2019, 14:20 |
dsar |
It is a very straightforward class |
# |
Dec 20th 2019, 14:19 |
dsar |
Just look at how OrmResolver is implemented: https://github.com/cakephp/authentication/tree/master/src/Identifier/Resolver |
# |
Dec 20th 2019, 14:14 |
luke |
All I found is the following, which tells you nothing: https://book.cakephp.org/authentication/1/en/identifiers.html#writing-your-own-resolver |
# |
Dec 20th 2019, 14:13 |
luke |
Hey, does anyone know if there is any documentation on creating a custom identity resolver for the new authentication plugin? |
# |
Dec 20th 2019, 14:09 |
tibor.hajos |
@dsar Thanks, I'll go check out the issues. |
# |
Dec 20th 2019, 14:09 |
val |
Hmmm... it is `array` but not `ArrayObject` there |
# |
Dec 20th 2019, 14:03 |
noel |
Oh.. I guess I'm not loading a config for CLI mode anymore since I configured for deployment :( |
# |
Dec 20th 2019, 14:01 |
noel |
bake has suddenly stopped working for me with this error: `Exception: If config is null, key must be an array.` Any clues? I tried rolling back my code to a version where I know bake was working – still borked. |
# |
Dec 20th 2019, 14:00 |
noel |
@val https://api.cakephp.org/3.8/class-Cake.ORM.Table.html#_save |
# |
Dec 20th 2019, 13:56 |
gianmarxgagliardi |
it was a typo |
# |
Dec 20th 2019, 13:55 |
dsar |
I know @noel ;) |
# |
Dec 20th 2019, 13:54 |
dsar |
@gianmarxgagliardi I didn't expect that would fix the problem, it is just better to use correct plurals in CakePHP |