# |
Jun 4th 2021, 19:32 |
kevin.pfeifer |
ok good, so you have a default.po file |
# |
Jun 4th 2021, 19:32 |
aengblom |
yes, poedit |
# |
Jun 4th 2021, 19:31 |
kevin.pfeifer |
PoEdit? |
# |
Jun 4th 2021, 19:31 |
kevin.pfeifer |
with what file do you edit/translate your .po file |
# |
Jun 4th 2021, 19:31 |
kevin.pfeifer |
:) |
# |
Jun 4th 2021, 19:31 |
aengblom |
Ok, this is where I am fuzzy |
# |
Jun 4th 2021, 19:30 |
kevin.pfeifer |
and you updated your .po file in your language with that new .pot file |
# |
Jun 4th 2021, 19:30 |
aengblom |
Yep |
# |
Jun 4th 2021, 19:29 |
kevin.pfeifer |
and inside your .pot file does the file/line also appear in the comments for that string? |
# |
Jun 4th 2021, 19:28 |
aengblom |
Yep, I did the extract command |
# |
Jun 4th 2021, 19:27 |
kevin.pfeifer |
do you generate your `.pot` file with the cake cli as well? |
# |
Jun 4th 2021, 19:25 |
aengblom |
Thanks for the tip! Unfortunately that didn't do it. I'm fairly new to this translating stuff. I've been studying the cakephp docs on i18n. If anyone has any video resources on the topic they would like to share, I would appreciate it very much. I do much better with videos for some reason. Thanks! |
# |
Jun 4th 2021, 19:17 |
kevin.pfeifer |
sometimes I need to do a `bin/cake cache clear_all` to have all newly tranlated strings be loaded correctly |
# |
Jun 4th 2021, 19:13 |
aengblom |
Has anyone ever encountered certain strings not translating even when __() is used and the string is translated in the po file? Nearly everything else in the app is translating except for a few strings. I'm not sure what is going on |
# |
Jun 4th 2021, 19:05 |
kevin.pfeifer |
sometimes its all just so flexible and can be re-used in so many places that it is hard to communicate a specific problem ^^ |
# |
Jun 4th 2021, 19:04 |
kevin.pfeifer |
but as you said Zuluru, Helpers are for Views (the V in MVC) :) However one decides to use that V :) |
# |
Jun 4th 2021, 19:03 |
greg138 |
And hence my question. ;) |
# |
Jun 4th 2021, 19:02 |
kevin.pfeifer |
sure. it depends what you define as backend and frontend :) |
# |
Jun 4th 2021, 19:02 |
greg138 |
And helpers can obviously be used in the views for admin pages. :) |
# |
Jun 4th 2021, 19:02 |
greg138 |
Some people consider "the admin pages" to be "backend", though... |
# |
Jun 4th 2021, 19:01 |
kevin.pfeifer |
shared backend logic can be inside components for controller or behaviours for models |
# |
Jun 4th 2021, 19:01 |
kevin.pfeifer |
the name "helper" in cakephp is mainly reserved for frontend logic |
# |
Jun 4th 2021, 19:01 |
greg138 |
What do you mean by "backend"? Helpers are for views. |
# |
Jun 4th 2021, 18:58 |
rightscoreanalysis |
Are Helpers for Cake mainly for the front end - since they reside in the 'view' folder. Does Cake not use Helpers for the backend? |
# |
Jun 4th 2021, 18:47 |
kevin.pfeifer |
I am currently thinking about implementing an e2e testing framework into my cakephp app and was just wondering of someone here has already some (good or bad) experience with a specific one :) |
# |
Jun 4th 2021, 16:48 |
kevin.pfeifer |
true that |
# |
Jun 4th 2021, 16:43 |
admad |
I actually don't mind the naked BS in backends but greatly dislike the BS "smell" in fronted designs |
# |
Jun 4th 2021, 16:43 |
kevin.pfeifer |
for the whole JS/SCSS generation |
# |
Jun 4th 2021, 16:43 |
kevin.pfeifer |
i also "still" use gulp4 instead of webpack or any other modern package bundler because it has everything I need and is not that complicated :) |
# |
Jun 4th 2021, 16:42 |
admad |
:+1: |
# |
Jun 4th 2021, 16:40 |
kevin.pfeifer |
sure my approach definitely takes more time but for me its worth it :) |
# |
Jun 4th 2021, 16:40 |
kevin.pfeifer |
sure its good to have basically everything you probably need in the future ready to just use it without the need to invest time for each "new" feature But I generally just dont like the bootstrap look aka. the "smell" :P |
# |
Jun 4th 2021, 16:38 |
admad |
But it's good for backends |
# |
Jun 4th 2021, 16:37 |
admad |
Sure is |
# |
Jun 4th 2021, 16:37 |
kevin.pfeifer |
and think that bootstrap is overloaded AF |
# |
Jun 4th 2021, 16:37 |
admad |
:clap: |
# |
Jun 4th 2021, 16:37 |
kevin.pfeifer |
nope, I am one of those crazy people who has its own library/grid system and builds everything else from scratch |
# |
Jun 4th 2021, 16:36 |
admad |
@kevin.pfeifer don't tell me you like tailwind instead :) |
# |
Jun 4th 2021, 16:34 |
kevin.pfeifer |
@ndm I keep my very unpopular opinion about bootstrap shut so I can't contribute something usefull there :) But I guess many other people would love to see bootstrap 5 support in that plugin |
# |
Jun 4th 2021, 16:30 |
admad |
In unrelated news middlewares at controller level have landed in 4.next https://github.com/cakephp/cakephp/pull/15558 Hopefully now one won't have to tackle the router to run middleware only for specific controllers/actions. |
# |
Jun 4th 2021, 16:28 |
admad |
Yeah that's great let me know when it's merged xP. |
# |
Jun 4th 2021, 15:29 |
slackebot |
https://github.com/FriendsOfCake/bootstrap-ui/pull/350 |
# |
Jun 4th 2021, 15:29 |
ndm |
I've posted it in friendsofcake already, but let me quickly also misuse this channel... If you're a user of `friendsofcake/bootstrap-ui`, and you have any opinion on Bootstrap 5 support, please check the following issue/PR, and leave some feedback if you have any. Suggestions, questions, whatever is on your heart... k thx bye! https://github.com/FriendsOfCake/bootstrap-ui/issues/349 |
# |
Jun 4th 2021, 10:17 |
paolo.bragagni |
thanks again |
# |
Jun 4th 2021, 10:17 |
paolo.bragagni |
tryng to reproduce my old skeleton.. :S |
# |
Jun 4th 2021, 10:17 |
paolo.bragagni |
I did some years ago for cake 2 |
# |
Jun 4th 2021, 10:16 |
paolo.bragagni |
yes yes thanks |
# |
Jun 4th 2021, 10:16 |
slackebot |
<paolo.bragagni> |
# |
Jun 4th 2021, 10:16 |
kevin.pfeifer |
there you go, now you have your reason :) Cakephp has many ways how you can deal with this, it just depends on how you want to deal with it |
# |
Jun 4th 2021, 10:13 |
paolo.bragagni |
now it works without the 'options' => $lingue |
# |
Jun 4th 2021, 10:13 |
paolo.bragagni |
Inflector::rules('irregular', ['lingua' => 'lingue']); |
# |
Jun 4th 2021, 10:11 |
kevin.pfeifer |
in your src/Table/MyTable.php in the initialize function there you can set ```$this->setDisplayField( 'name' );``` |
# |
Jun 4th 2021, 10:09 |
paolo.bragagni |
no i mean the default field 'title' of the model |
# |
Jun 4th 2021, 10:08 |
kevin.pfeifer |
your "title" of your form can be changed via the `label` key ```$this->Form->control('lingua_id', [ 'options' => $lingue 'label' => 'My Label' ] )``` |
# |
Jun 4th 2021, 10:08 |
slackebot |
<paolo.bragagni> |
# |
Jun 4th 2021, 10:08 |
paolo.bragagni |
Yes but in list I see the languages |
# |
Jun 4th 2021, 10:06 |
kevin.pfeifer |
i think it has to do with the way cakephp expects your tables, variables etc. to english based https://book.cakephp.org/3/en/intro/conventions.html#view-conventions ```By default CakePHP uses English inflections. If you have database tables/columns that use another language, you will need to add inflection rules (from singular to plural and vice-versa). You can use Cake\Utility\Inflector to define your custom inflection |
# |
Jun 4th 2021, 10:06 |
slackebot |
rules. See the documentation about Inflector for more information.``` |
# |
Jun 4th 2021, 10:04 |
paolo.bragagni |
(how to change the name of the 'title.. I dont remember..) |
# |
Jun 4th 2021, 10:04 |
slackebot |
<paolo.bragagni> |
# |
Jun 4th 2021, 10:03 |
paolo.bragagni |
autore is filled |
# |
Jun 4th 2021, 10:03 |
paolo.bragagni |
<td> <?= $this->Form->control('lingua_id', ['options' => $lingue] )?> </td> <td> <?= $this->Form->control('autore_id') ?> </td> |
# |
Jun 4th 2021, 10:03 |
paolo.bragagni |
but why |
# |
Jun 4th 2021, 10:02 |
paolo.bragagni |
it works |
# |
Jun 4th 2021, 09:59 |
philo.hamel |
*lingue ;) |
# |
Jun 4th 2021, 09:58 |
philo.hamel |
```$this->Form->control('lingua_id', ['options' => $libri]),``` |
# |
Jun 4th 2021, 09:54 |
paolo.bragagni |
but lingue remain emty.. :S |
# |
Jun 4th 2021, 09:53 |
paolo.bragagni |
autori is filled (with id , but probably I didnt define the title of the table) |
# |
Jun 4th 2021, 09:52 |
paolo.bragagni |
$lingue = $this->Libri->Lingue->find('list', ['limit' => 200]); $autori = $this->Libri->Autori->find('list', ['limit' => 200]); $this->set(compact('libri','lingue','autori')); |
# |
Jun 4th 2021, 09:50 |
kevin.pfeifer |
I haven't dealt with the friendsofcake search plugin myself because i built my own search logic before I found that plugin But i guess this is what you need to do ^^ |
# |
Jun 4th 2021, 09:47 |
kevin.pfeifer |
so yes, you need to get the entries in your controller, set them to have them in your view and then use that array as an `options` key for your field |
# |
Jun 4th 2021, 09:46 |
kevin.pfeifer |
```// You'll need to populate $authors in the template from your controller echo $this->Form->control('author_id');``` |
# |
Jun 4th 2021, 09:46 |
kevin.pfeifer |
based on the doc https://github.com/FriendsOfCake/search/tree/master/docs#creating-your-form |
# |
Jun 4th 2021, 09:46 |
paolo.bragagni |
$query = $this->Libri ->find('search', ['search' => $this->request->getQueryParams()]); $this->paginate = [ 'contain' => ['Lingue', 'Autori'], ]; $libri = $this->paginate($query); $this->set(compact('libri')); |
# |
Jun 4th 2021, 09:46 |
paolo.bragagni |
in controller: |
# |
Jun 4th 2021, 09:44 |
paolo.bragagni |
in my view I have only <?= $this->Form->control('lingua_id') ?> |
# |
Jun 4th 2021, 09:44 |
paolo.bragagni |
I have to fill in controller? |
# |
Jun 4th 2021, 09:43 |
paolo.bragagni |
yes |
# |
Jun 4th 2021, 09:39 |
kevin.pfeifer |
so your dropdown is empty? |
# |
Jun 4th 2021, 09:33 |
paolo.bragagni |
'Lingua' (language) related to 'Libri' (book) is a combobox but is empty |
# |
Jun 4th 2021, 09:31 |
slackebot |
<paolo.bragagni> |
# |
Jun 4th 2021, 09:28 |
kevin.pfeifer |
what do you mean by combobox? |
# |
Jun 4th 2021, 09:19 |
paolo.bragagni |
how to insert combobox in friendsofcake search (for related table) |
# |
Jun 4th 2021, 08:41 |
erwane |
It's the Break at first line option. Thanks |
# |
Jun 4th 2021, 08:06 |
kevin.pfeifer |
or do you have a `xdebug_break()` at the end of your config/requirements.php? |
# |
Jun 4th 2021, 07:58 |
kevin.pfeifer |
which i guess you have enabled |
# |
Jun 4th 2021, 07:57 |
kevin.pfeifer |
There is a “Break at first line” Option in the “Run” menu |
# |
Jun 4th 2021, 07:42 |
erwane |
Do you have any configuration clues for CakePHP+Phpstorm+xdebug please ? |
# |
Jun 4th 2021, 07:42 |
erwane |
Hi. I'm trying to configure xdebug in phpstorm with cakephp 4. The debugger always step on the webtoor/index.php at this line : ```// For built-in server if (php_sapi_name() === 'cli-server') {``` |
# |
Jun 3rd 2021, 22:59 |
slackebot |
https://stackoverflow.com/questions/67829501/how-do-i-manage-read-and-write-aws-aurora-host-endpoints-in-cakephp |
# |
Jun 3rd 2021, 22:59 |
jadelbe418 |
Been writing out an implementation in the Cake ORM to support separate read vs cluster endpoints when querying against AWS Aurora. Was wondering if Cake had any tricks for applying the different endpoints to the host value in the data source config, depending on if the query is a read or a write. Here is is a more detailed version of my question with code samples: |
# |
Jun 3rd 2021, 19:07 |
richard |
ugh |
# |
Jun 3rd 2021, 19:07 |
richard |
@dereuromark was just me not realizing some of the files on the drive were owned by another user, was able to solve it |
# |
Jun 3rd 2021, 17:40 |
dereuromark |
maybe you use the wrong user for crontab, if you are using that to spawn. make sure to -u here for it to edit |
# |
Jun 3rd 2021, 17:25 |
kevin.pfeifer |
if you get an error and have xdebug running you can try to add a `xdebug_break()` at that line and trace back where it comes from and probably have a better understanding of why your process changes user |
# |
Jun 3rd 2021, 17:19 |
richard |
I’m running into an error where a worker is running as something other than www-data but when i grep for the workers the only ones i see are running as www-data |
# |
Jun 3rd 2021, 17:12 |
jpramirez |
@richard `su -s /bin/bash -c "bin/cake" www-data` maybe? |
# |
Jun 3rd 2021, 17:06 |
dereuromark |
that works for me, yes |
# |
Jun 3rd 2021, 16:55 |
richard |
i tried sudo -u www-data bin/cake queue runworker |
# |
Jun 3rd 2021, 16:55 |
jpramirez |
@v.plancher I highly recommend you to use fixture factories to insert test fixtures. You will not have to care about your schema, as it is handled with migrations, your tests will be independent, they will run faster and they will be more readable. And faster to write too. https://github.com/vierge-noire/cakephp-fixture-factories https://book.cakephp.org/4/en/development/testing.html#fixture-factories |