# |
Oct 21st 2019, 17:36 |
night_wulfe |
@admad Thanks. Anything you see immediately wrong, or could be improved, with this? https://pastebin.com/1FESVLgg |
# |
Oct 21st 2019, 17:35 |
ron.rattie |
heyo! |
# |
Oct 21st 2019, 17:35 |
ricksaccous |
lollll |
# |
Oct 21st 2019, 17:35 |
ricksaccous |
I'm up front bby, same as with the ladies you know |
# |
Oct 21st 2019, 17:35 |
ron.rattie |
ah crap.. you're no fun |
# |
Oct 21st 2019, 17:35 |
ricksaccous |
;) |
# |
Oct 21st 2019, 17:35 |
ricksaccous |
@ron.rattie it's not a secret, lol |
# |
Oct 21st 2019, 17:34 |
ron.rattie |
@ricksaccous I'm gonna rat you out |
# |
Oct 21st 2019, 17:33 |
admad |
Better to have that complexity tucked inside a custom finder rather than anywhere else :) |
# |
Oct 21st 2019, 17:32 |
night_wulfe |
Thanks. Whenever I do that i always seem to end up writing a lot of code that tries to merge whatever options the user sends with whatever my defaults are and it just seems overly complicated; I feel like I'm doing something wrong. |
# |
Oct 21st 2019, 17:32 |
admad |
Ah you are asking *if* it is a good idea, sure nothing wrong with that |
# |
Oct 21st 2019, 17:31 |
admad |
@night_wulfe did you try just passing custom key like your 1st example? |
# |
Oct 21st 2019, 17:24 |
ricksaccous |
or whatever the equivalent of namespacing is in JS |
# |
Oct 21st 2019, 17:23 |
ricksaccous |
otherwise i dislike the idea |
# |
Oct 21st 2019, 17:23 |
ricksaccous |
either that or you do the work of checking the dependencies |
# |
Oct 21st 2019, 17:23 |
night_wulfe |
Is it a good idea to add your own keys to custom finder options in CakePHP 2.x? like `$this->find('custom', array('device' => $foo))` where the custom find type will set the conditions accordingly? Or should the caller of the custom find type set the condition manually as in `$this->find('custom', array('conditions' => array('device' => $foo)));`? |
# |
Oct 21st 2019, 17:23 |
ricksaccous |
@dereuromark it's fine to do so if the js doesn't have dependencies and is namespaced imo |
# |
Oct 21st 2019, 17:21 |
admad |
Can't give all my shit for free x) |
# |
Oct 21st 2019, 17:20 |
dereuromark |
where's the FOSS plugin for it?^^ |
# |
Oct 21st 2019, 17:20 |
admad |
Of and check to just delete existing image if its optional |
# |
Oct 21st 2019, 17:19 |
admad |
It have made plenty simple and complex widgets. For eg one i have generates file input with thumb using existing entity and shows preview of new image selected for uploading :slightly_smiling_face: |
# |
Oct 21st 2019, 17:17 |
dereuromark |
E.g. |
# |
Oct 21st 2019, 17:17 |
dereuromark |
For datetime select perfectly fine to do so |
# |
Oct 21st 2019, 17:17 |
admad |
Though i have them too |
# |
Oct 21st 2019, 17:17 |
admad |
Yeah widgets with js are a catch 20 |
# |
Oct 21st 2019, 17:12 |
ricksaccous |
because it makes it hard to deal with script order/etc |
# |
Oct 21st 2019, 17:12 |
ricksaccous |
but that's just me |
# |
Oct 21st 2019, 17:12 |
ricksaccous |
i personally don't like that tbh |
# |
Oct 21st 2019, 17:12 |
ricksaccous |
heh we make widgets that include js |
# |
Oct 21st 2019, 17:10 |
admad |
https://github.com/cakephp/cakephp/blob/69840376389fcd003ac83dd29176e31898da8960/src/View/Helper/FormHelper.php#L177 In similar array include `'_view'` |
# |
Oct 21st 2019, 16:49 |
dereuromark |
wanted to try an inline addition: https://pastebin.com/i9940yji that one then doesnt support it it seems. |
# |
Oct 21st 2019, 16:44 |
dereuromark |
but not what it means, like how etc. |
# |
Oct 21st 2019, 16:44 |
dereuromark |
well, ok "f your widget needs access to the View, you should use the _view ‘widget’" |
# |
Oct 21st 2019, 16:43 |
dereuromark |
are there any docs on how to make view available in general? https://book.cakephp.org/3.0/en/views/helpers/form.html#using-widgets doesnt mention any of it. |
# |
Oct 21st 2019, 16:42 |
dereuromark |
ah ok, sounds a bit more complicated than I thought, since the widget itself requires $templates as contructur arg again |
# |
Oct 21st 2019, 16:42 |
admad |
You can use special string `_view` to pass the view instance as argument |
# |
Oct 21st 2019, 16:41 |
admad |
@dereuromark they are but you have to wire them in FormHelper options where you can specify the arguments |
# |
Oct 21st 2019, 16:40 |
dereuromark |
Would it make sense to have the view available in general in future versions? |
# |
Oct 21st 2019, 16:40 |
jotpe |
I set the user_id manually in the Controller by: $application->user_id = $this->Authentication->getIdentity()->getIdentifier(); |
# |
Oct 21st 2019, 16:40 |
dereuromark |
Arent widgets autoconstructed inside locator? I guess then I have to manually create one :slightly_smiling_face: ok |
# |
Oct 21st 2019, 16:39 |
jotpe |
The Error also says: Please try correcting the issue for the following table aliases: *Memberships.Users* |