# |
Mar 29th 2019, 18:23 |
itmpls |
it seems like it'd be an easy thing |
# |
Mar 29th 2019, 18:23 |
itmpls |
i'm just curious for a way that doesn't involve hardcoding field names yeah |
# |
Mar 29th 2019, 18:23 |
ricksaccous |
because you are making your own columns? |
# |
Mar 29th 2019, 18:22 |
ricksaccous |
? |
# |
Mar 29th 2019, 18:22 |
ricksaccous |
so you couldn't even rely on the schema |
# |
Mar 29th 2019, 18:22 |
itmpls |
so i might not know the fields ahead of time |
# |
Mar 29th 2019, 18:22 |
ricksaccous |
oh |
# |
Mar 29th 2019, 18:22 |
ricksaccous |
if you just don't want them to be frozendates or whatever |
# |
Mar 29th 2019, 18:22 |
itmpls |
this is a case where it can be random (since its reporting and may be various random fields) |
# |
Mar 29th 2019, 18:22 |
ricksaccous |
there's also the database types you could play around with |
# |
Mar 29th 2019, 18:22 |
ricksaccous |
or whatever |
# |
Mar 29th 2019, 18:22 |
ricksaccous |
you can just define all date fields in an array and do foreach ($dateFieldArray as $dateField) { processDateField($entity->{$dateField}); |
# |
Mar 29th 2019, 18:20 |
itmpls |
otherwise i'll fallback to collections or something |
# |
Mar 29th 2019, 18:20 |
itmpls |
like i wanna enumerate and convert if say the value is an instanceof FrozenDate etc |
# |
Mar 29th 2019, 18:20 |
itmpls |
yeah i was curious if there was some other way of doing it. im curious why get_object_vars wont do it |
# |
Mar 29th 2019, 18:20 |
ricksaccous |
depends on what you are trying to get and where |
# |
Mar 29th 2019, 18:19 |
ricksaccous |
you can extract() the property and turn that into a collection and then use collection magic on that |
# |
Mar 29th 2019, 18:19 |
ricksaccous |
lol |
# |
Mar 29th 2019, 18:19 |
ricksaccous |
turn the entity into a collection and use collection magic |
# |
Mar 29th 2019, 18:15 |
itmpls |
i want to be able to iterate dynamically and conditionally format based on the property |
# |
Mar 29th 2019, 18:14 |
itmpls |
am i having a brain freeze or is there an easy way to iterate through all properties of an entity dynamically? its just an object and i tried get_object_vars and using ReflectionClass.. is there some cake way I'm forgetting? |
# |
Mar 29th 2019, 14:37 |
jksM |
Solved the problem - turned out the permissions on the Locale folder created was so that it was not accessible by the webserver software |
# |
Mar 29th 2019, 14:22 |
jksM |
I see that the locale is indeed changed, as date/time is now shown according to the chosen location, but texts are still not translated. |
# |
Mar 29th 2019, 14:21 |
jksM |
I'm having trouble getting gettext based translations working with cakephp 3.7... followed the cookbook, but the text is still displayed in English. I have marked up the text with __(), used i18n extra to create the .pot file, created /src/Locale/da/default.po with translations, and set defaultLocale in config/app.php to da. Any ideas on what I could be missing here? |
# |
Mar 29th 2019, 14:14 |
joopm |
i read a lot the cookbook, also the logs here but quite often i faced some new things what i can not solve myself.. |
# |
Mar 29th 2019, 14:13 |
joopm |
thank you,i am a member since cake 2.1 |
# |
Mar 29th 2019, 14:13 |
joopm |
just dont understand that it was working in AppController without the getController |
# |
Mar 29th 2019, 14:13 |
admad |
you will with time :slightly_smiling_face: |
# |
Mar 29th 2019, 14:12 |
joopm |
i wish i could have deeper knowledge |
# |
Mar 29th 2019, 14:12 |
joopm |
thank you admad your help |
# |
Mar 29th 2019, 14:09 |
admad |
access it using `$this->getController()->viewBuilder()` |
# |
Mar 29th 2019, 14:08 |
admad |
just adding a "use" statement does not magically provided you an instance of that class |
# |
Mar 29th 2019, 14:05 |
joopm |
i appended use Cake\View\ViewBuilder; but does not solve the issue |
# |
Mar 29th 2019, 14:04 |
joopm |
is anyone know why i get undefinied method error to viewBuilder in my component? |
# |
Mar 29th 2019, 14:03 |
liaogz82 |
ok thanks |
# |
Mar 29th 2019, 14:02 |
admad |
@liaogz82 @markstory might be able to help you |
# |
Mar 29th 2019, 14:01 |
liaogz82 |
or someone to double check it |
# |
Mar 29th 2019, 14:00 |
grossolive4 |
hello |
# |
Mar 29th 2019, 13:57 |
liaogz82 |
who do I ask? |
# |
Mar 29th 2019, 13:57 |
liaogz82 |
i need resources to prep my slides |
# |
Mar 29th 2019, 13:57 |
liaogz82 |
theme framework wars |