# |
Jul 15th 2019, 20:57 |
ricksaccous |
you were just following the docs |
# |
Jul 15th 2019, 20:57 |
ricksaccous |
oh wait lmao |
# |
Jul 15th 2019, 20:57 |
ricksaccous |
but probably $this->addPlugin('Sequence'); will just work |
# |
Jul 15th 2019, 20:56 |
ricksaccous |
you should learn about namespacing |
# |
Jul 15th 2019, 20:54 |
yamcomnet |
not sure how this plugin business goes nowadays. It added $this->addPlugin('Admad/sequence) to Application.php but i keep getting Fatal error: Uncaught Cake\Core\Exception\MissingPluginException: Plugin Admad/sequence could not be found. in |
# |
Jul 15th 2019, 20:39 |
yamcomnet |
what do you do when non programmer starts to do business software :) |
# |
Jul 15th 2019, 20:38 |
yamcomnet |
made the frontend and was not able to do actual algo :) |
# |
Jul 15th 2019, 20:38 |
yamcomnet |
actually thats exactly what i need. Cheers! |
# |
Jul 15th 2019, 20:37 |
challgren |
That plugin will be helpful then |
# |
Jul 15th 2019, 20:36 |
yamcomnet |
thanks guys! I need to store new prioritys to database after sorting |
# |
Jul 15th 2019, 20:35 |
ricksaccous |
@yamcomnet this is what i was talking about https://api.jqueryui.com/sortable/ |
# |
Jul 15th 2019, 20:35 |
ricksaccous |
that's a handy behavior |
# |
Jul 15th 2019, 20:33 |
challgren |
https://github.com/ADmad/cakephp-sequence |
# |
Jul 15th 2019, 20:32 |
ricksaccous |
you take that in and set priority numbers based on those |
# |
Jul 15th 2019, 20:32 |
ricksaccous |
then it serializes them all |
# |
Jul 15th 2019, 20:32 |
ricksaccous |
there are jquery ui libs that allow you to just get all the image ids if you put them in some data attribute |
# |
Jul 15th 2019, 20:31 |
yamcomnet |
basic programming question follows(which im not able to solve properly :slightly_smiling_face:. I have images sorted by priority. User clicks up/down arrows. I want to reorder prioritys. Whats the approach for the algo? |
# |
Jul 15th 2019, 18:50 |
daniel.upshaw |
I was thinking about control instantiation |
# |
Jul 15th 2019, 18:50 |
daniel.upshaw |
Actually I think you're right, yeah |
# |
Jul 15th 2019, 18:49 |
daniel.upshaw |
Or what works that is |
# |
Jul 15th 2019, 18:49 |
daniel.upshaw |
Okay, I'm really curious if this works |
# |
Jul 15th 2019, 18:49 |
daniel.upshaw |
Or that perhaps |
# |
Jul 15th 2019, 18:49 |
daniel.upshaw |
```<?php // Using a classname. $this->Form->addWidget( 'ToggleInput', ['widgets' => ['Theme.ToggleInput', 'checkbox', 'nestingLabel']] );``` |
# |
Jul 15th 2019, 18:49 |
ricksaccous |
i'll try that later though |
# |
Jul 15th 2019, 18:49 |
ricksaccous |
I think if anything would work it would be this |
# |
Jul 15th 2019, 18:49 |
daniel.upshaw |
Hmmm |
# |
Jul 15th 2019, 18:48 |
slackebot |
<ricksaccous> |
# |
Jul 15th 2019, 18:48 |
daniel.upshaw |
(Just guessing here) |
# |
Jul 15th 2019, 18:47 |
daniel.upshaw |
```[ 'widgets' => [ 'toggleInput' => ['Theme\View\Widget\ToggleInput', 'nestingLabel'] ] ]``` |
# |
Jul 15th 2019, 18:47 |
daniel.upshaw |
It might not be exactly that though |
# |
Jul 15th 2019, 18:46 |
daniel.upshaw |
@ricksaccous I wonder if that would modify `$_defaultWidgets` |
# |
Jul 15th 2019, 18:46 |
daniel.upshaw |
```[ 'widgets' => [ 'toggleInput' => ['nestingLabel'] ] ]``` |
# |
Jul 15th 2019, 18:45 |
daniel.upshaw |
https://book.cakephp.org/3.0/en/views/helpers/form.html#using-widgets |
# |
Jul 15th 2019, 18:45 |
ricksaccous |
anyway an element is not a bad solution imo |
# |
Jul 15th 2019, 18:44 |
ricksaccous |
yeah I'm not going to mess with formHelper just to get what i want out of this widget, lol |
# |
Jul 15th 2019, 18:43 |
daniel.upshaw |
I think that `$_defaultWidgets` looks promising |
# |
Jul 15th 2019, 18:43 |
daniel.upshaw |
But this is your custom |
# |
Jul 15th 2019, 18:43 |
daniel.upshaw |
Ah |
# |
Jul 15th 2019, 18:43 |
daniel.upshaw |
`By default CakePHP nests checkboxes created via control() and radio buttons created by both control() and radio() within label elements.` |
# |
Jul 15th 2019, 18:42 |
daniel.upshaw |
https://book.cakephp.org/3.0/en/views/helpers/form.html#moving-checkboxes-radios-outside-of-a-label |
# |
Jul 15th 2019, 18:42 |
daniel.upshaw |
For `control()` |