# |
Jul 7th 2017, 15:00 |
glanceded |
@hmic I see, so I need to create my own type. I found here how to do that, but I can't find how to use it after I create it |
# |
Jul 7th 2017, 14:58 |
gutts |
with a built-in? |
# |
Jul 7th 2017, 14:58 |
gutts |
is there an easy way to extract the first nested error message in $errors = $model->errors(); after validation? |
# |
Jul 7th 2017, 14:57 |
jarard01 |
although in my case it doesn't seem to be calling either of the views in that location |
# |
Jul 7th 2017, 14:57 |
hmic |
glanceded: you dont need to work in the entity. you need a custom database type to do that |
# |
Jul 7th 2017, 14:56 |
jarard01 |
thanks |
# |
Jul 7th 2017, 14:56 |
jdominguezpaz |
@jarard01 /view/errors/missin_controller.ctp |
# |
Jul 7th 2017, 14:54 |
glanceded |
hi guys. I need to save an ip in my db as integer, using INET6_ATON to "compress" the ip. I think that by usign magic function _setIp on my entity would do the job, but I don't know how to pass the mysql function to the query |
# |
Jul 7th 2017, 14:54 |
jdominguezpaz |
@admad I'm not sure to understand that... I understand that I can't inflect both words in FrecuenciaSemanal to FrecuenciasSemanales? |
# |
Jul 7th 2017, 14:53 |
jarard01 |
in cake2 if I call a non-existent controller or method, which template is displayed? |
# |
Jul 7th 2017, 14:52 |
admad |
for inflector that's one word not 2. Only the ending of a string matters |
# |
Jul 7th 2017, 14:51 |
hmic |
good work mic_! |
# |
Jul 7th 2017, 14:51 |
jdominguezpaz |
@admad I set the my irregular cases but I think I can't achieve inflecting the 2 words of, for example, "FrecuenciaSemanal" , with those rules. am I mistaken? |
# |
Jul 7th 2017, 14:49 |
eBugg |
setting your own inflections rules is an option but it's a huge task |
# |
Jul 7th 2017, 14:49 |
mic_ |
hmic: it was 5 minute job to create a custom widget and just munch the numbers in my own way ;) |
# |
Jul 7th 2017, 14:49 |
mic_ |
hmic: thanks for the tip with a widget! |
# |
Jul 7th 2017, 14:49 |
admad |
set your custom inflection rules |
# |
Jul 7th 2017, 14:49 |
admad |
@jdominguezpaz https://github.com/cakephp/app/blob/master/config/bootstrap.php#L197 |
# |
Jul 7th 2017, 14:44 |
jdominguezpaz |
it's an option. It's that or go full one-word. And, one hour and a half into this I'm close to surrender (again) and stick to one of these |
# |
Jul 7th 2017, 14:43 |
eBugg |
RetiradaAsociado -> retirada_asociados even if it should be retiradas_asociados |
# |
Jul 7th 2017, 14:42 |
eBugg |
even if it's a grammatical error in Spanish |
# |
Jul 7th 2017, 14:42 |
jdominguezpaz |
And this is a recurrent problem in my projects and I think enough is enough. Stop with naming "Frecuenciasemanal" as one word |
# |
Jul 7th 2017, 14:42 |
eBugg |
i'm coding in Spanish too and I usually only inflects the noun in my table names. ->FrecuenciaSemanal (table: frecuencia_semanales) |
# |
Jul 7th 2017, 14:42 |
neon1024 |
Write your own inflector? |
# |
Jul 7th 2017, 14:40 |
jdominguezpaz |
Yes, if I stick to english the problem would be gone but then i can't bake anything. I can't change database tables names :( |
# |
Jul 7th 2017, 14:38 |
hmic |
my advice still would be: go with english in your codebase! |
# |
Jul 7th 2017, 14:38 |
hmic |
and you need both wayes i think, singular to plural and plural to singular |
# |
Jul 7th 2017, 14:38 |
hmic |
you need to match the case in the irregular settings of course |
# |
Jul 7th 2017, 14:37 |
jdominguezpaz |
yeah... I have 'frecuenciasemanal'=>'frecuenciassemanales' in irregular but i Get FrecuenciaSemanal->Frecuenciassemanales without the second word capitalized when pluralize |
# |
Jul 7th 2017, 14:36 |
hmic |
you should likely use english names inside your app source anyways! |
# |
Jul 7th 2017, 14:36 |
hmic |
the inflector is only good at english at all |
# |
Jul 7th 2017, 14:36 |
jdominguezpaz |
(of course i'm spanis so... my apologies for any kick to the english language in my writing) :) |
# |
Jul 7th 2017, 14:36 |
hmic |
it's irregular in this case :p |
# |
Jul 7th 2017, 14:35 |
slackebot |
FrecuenciasSemanales) we need to inflect both words almost always. Is there a way to get this? |
# |
Jul 7th 2017, 14:35 |
jdominguezpaz |
Hello, I'm struggling trying to get inflector inflects in spanish. :slightly_smiling_face: It's no problem to me to declare all "irregular" spanish nouns in bootstrap.php in a one by one basis (there are not too many) but I have problems inflecting two words and I think is because plural adjectives. For example: Normal pluralize (BigApple => BigApples) only inflects the noun which is the second word. In Spanish (FrecuenciaSemanal => |
# |
Jul 7th 2017, 14:30 |
inoas |
it should be @ hmic |
# |
Jul 7th 2017, 14:30 |
hmic |
mic_, yeah, just extend the htmlhelper in your app to add the type |
# |
Jul 7th 2017, 14:30 |
mic_ |
hmic: I have just found out, that Form finds out of course types and so on - but no locale formatting applied. |
# |
Jul 7th 2017, 14:29 |
hmic |
nice inoas! should be the default on debug=true |
# |
Jul 7th 2017, 14:29 |
mic_ |
hmic: I am trying to figure out a way to do it, because that would be it - extend and override a bit in the standard. |
# |
Jul 7th 2017, 14:27 |
hmic |
not that hard actually |