# |
May 29th 2021, 21:05 |
kevin.pfeifer |
working solutions (even badly designed/implemented) are better than no solutions :) but if you already know that there is a “better way” then you can at least take the time later on to improve and refactor your app |
# |
May 29th 2021, 21:04 |
etibor |
sometimes my solution are not the most smooth and elegant but keep working to learn |
# |
May 29th 2021, 21:03 |
etibor |
when page display error during |
# |
May 29th 2021, 21:03 |
etibor |
hahah i did it live application, sometimes users became crazy |
# |
May 29th 2021, 21:02 |
kevin.pfeifer |
thats one thing i hoped i learned sooner than later |
# |
May 29th 2021, 21:02 |
kevin.pfeifer |
are you using tests already? :) |
# |
May 29th 2021, 21:02 |
etibor |
luckily i am able to handle most of the things |
# |
May 29th 2021, 21:01 |
etibor |
yes i have the same feeling that its gonna be never perfect |
# |
May 29th 2021, 21:01 |
kevin.pfeifer |
whichever it is it that moment |
# |
May 29th 2021, 21:01 |
kevin.pfeifer |
there will always be something that makes problems with your app, its just the fact, that you need to analyse it and try to fix it in a “better way” |
# |
May 29th 2021, 21:01 |
etibor |
thank you Kevin you really cool |
# |
May 29th 2021, 21:00 |
kevin.pfeifer |
i had many revelations over the last 2 years working with cake like custom Bake Templates, using template elements as much as possible, the new Dependency Injection Container etc. The “deep knowledge” just comes over time so don’t stress yourself too hard ;) |
# |
May 29th 2021, 20:58 |
etibor |
its almost the first time that i use this technique |
# |
May 29th 2021, 20:57 |
etibor |
probably its because its uses elements, and a component |
# |
May 29th 2021, 20:57 |
kevin.pfeifer |
sure there are many things to learn but thats coding in general in my opinion :) There will always be more to learn because we thankfully don’t stand still. |
# |
May 29th 2021, 20:56 |
etibor |
lot of time i feel i only on the top of the iceberg |
# |
May 29th 2021, 20:55 |
etibor |
you have soo deep knowledge, i wish i could have such as |
# |
May 29th 2021, 20:54 |
kevin.pfeifer |
i would guess it depends on which helper it uses |
# |
May 29th 2021, 20:53 |
etibor |
just dont understand this really, because other times the error message displayed correctly in a collactable div |
# |
May 29th 2021, 20:53 |
etibor |
you were right |
# |
May 29th 2021, 20:52 |
kevin.pfeifer |
well :) |
# |
May 29th 2021, 20:52 |
etibor |
go back to the root folder: vendor/cakephp/cakephp/src/View/Helper/FormHelper.php:115: 'error' => '<div class="error-message">{{content}}</div> |
# |
May 29th 2021, 20:52 |
etibor |
sorry i was wrong |
# |
May 29th 2021, 20:52 |
kevin.pfeifer |
because the default error template in cake3 contains that class https://github.com/cakephp/cakephp/blob/3.x/src/View/Helper/FormHelper.php#L113 |
# |
May 29th 2021, 20:51 |
etibor |
its cake3 |
# |
May 29th 2021, 20:51 |
kevin.pfeifer |
is this your cake2 project? |
# |
May 29th 2021, 20:50 |
etibor |
i think if grep does not show 'error-message' that means not exist |
# |
May 29th 2021, 20:49 |
kevin.pfeifer |
so you are sure you didn’t set ```'error' => '<div class="error-message">{{content}}</div>',``` inside your form helper or some custom template? |
# |
May 29th 2021, 20:42 |
etibor |
a strange thing happened on my form , when the field is invalid the error message class rendered as class="error-message" insted of class="error message" i tried to grep for error-message in the whole cake folder but returns nothing i dont know what could gives this class insted of the proper |
# |
May 29th 2021, 19:37 |
inoas |
@admad freenode is dead... ##php along #maria #postgresql #javascript #elixirlang and many others moved to libre chat |
# |
May 29th 2021, 19:36 |
inoas |
...briding |
# |
May 29th 2021, 19:36 |
inoas |
with bots birding? |
# |
May 29th 2021, 19:36 |
inoas |
@admad we got discord and matrix, too? |
# |
May 29th 2021, 18:19 |
ndm |
There's more to it, but basically, application rules ensure data integrity, and validation rules ensure request validity. |
# |
May 29th 2021, 18:17 |
etibor |
thank you really much for your help, thats what i need just not be really clear with the terminology |
# |
May 29th 2021, 18:11 |
ndm |
https://book.cakephp.org/3/en/orm/validation.html#applying-application-rules |
# |
May 29th 2021, 18:11 |
ndm |
That's what I mean... application rules live in / are applied in the model, in the transaction that saves the data. |
# |
May 29th 2021, 18:10 |
etibor |
i can implament in the controller for sure, but would be good to leave alone the controller now and add to the Model |
# |
May 29th 2021, 18:09 |
ndm |
@etibor That sounds like a job for a custom application rule where you query the storage row and check whether the score is valid. |
# |
May 29th 2021, 18:05 |
dereuromark |
@admad The "ADmad" release is freshly baked :) https://github.com/dereuromark/cakephp-geo/releases/tag/2.1.0 |
# |
May 29th 2021, 18:04 |
etibor |
the scenerio is like : Documents have an storage_id, score field(store an int) the maximal and minimal value is stored in the storage Model so Document's score depend on Storage minimal and maximal field |