# |
Nov 12th 2019, 14:12 |
pieceof |
k, ty sir |
# |
Nov 12th 2019, 14:11 |
admad |
@pieceof if you want to be able to use to order using `?sort=tile` for e.g. then yes `Paginator` can do that for you |
# |
Nov 12th 2019, 14:08 |
admad |
if you use foc/search plugin it will handle it for you :slightly_smiling_face: |
# |
Nov 12th 2019, 14:08 |
pieceof |
do i need to load paginator in order to get orderable api json response? |
# |
Nov 12th 2019, 14:07 |
devito |
thanks |
# |
Nov 12th 2019, 14:07 |
devito |
ill give it a shot |
# |
Nov 12th 2019, 14:06 |
devito |
mm |
# |
Nov 12th 2019, 14:06 |
pieceof |
i use to set a default if are not set, (first page load) (cake2) |
# |
Nov 12th 2019, 14:04 |
devito |
do I need to handle the query params in the controller afterwards? |
# |
Nov 12th 2019, 14:03 |
admad |
`$this->Paginator->options(['url' => ['?' => $this->request->getQuery()]])` |
# |
Nov 12th 2019, 14:01 |
devito |
I hae a form i use to search which goes to a results page with pagination. how do i persist the search params between pages? |
# |
Nov 12th 2019, 13:17 |
conehead |
Okay thank you. Will have to look for it recursively then |
# |
Nov 12th 2019, 13:17 |
massimoi |
this is what I did in Cake2, but how can I get the path of the view in Cake3? If I do $this->viewBuilder()->getTemplatePath( ); I always get a empty string |
# |
Nov 12th 2019, 13:16 |
admad |
@conehead then there's no way to get all the children in a single query |
# |
Nov 12th 2019, 13:16 |
slackebot1 |
array_unshift($path,$locale); } |
# |
Nov 12th 2019, 13:16 |
massimoi |
@tobse not sure to have understood... what I see is localization, meaning I can edit single strings in the page. But how do I choose a different .ctp when the language is different? if ($this->theme) { $theme_path = DS . 'Themed' . DS . $this->theme ; } if ($locale andand file_exists(APP . 'View' . $theme_path . DS . $this->viewPath . DS . $locale .DS. implode('/', $path) . $this->ext )) { |
# |
Nov 12th 2019, 13:15 |
conehead |
Ah. Seems to be for Tree-Behavior. I am not using that behavior...just threaded data :S |
# |
Nov 12th 2019, 13:15 |
conehead |
I will have a look thanks. Never have seen `for` |
# |
Nov 12th 2019, 13:14 |
admad |
`->find('children', [for =>id])->find('threded')` |
# |
Nov 12th 2019, 13:13 |
conehead |
Which does not seem to be a nice solution :P |
# |
Nov 12th 2019, 13:13 |
conehead |
And just chain them like 20 times |
# |
Nov 12th 2019, 13:13 |
conehead |
this won't get me all children. Could do ``` 'contain' => [ 'Children' => [ 'Children' => [ ... ], ], ]; ``` |
# |
Nov 12th 2019, 13:11 |
dereuromark |
contain => Chhildren? |
# |
Nov 12th 2019, 13:09 |
conehead |
Hm is there a simple way to find all threaded data from a specific node? Simple `->where(['id' => $id])` will always return only the one result as the children are filtered as well |
# |
Nov 12th 2019, 12:38 |
dereuromark |
you shouldnt do that. but if you do, best to use the whitelist, instead of forceEnable as global one |
# |
Nov 12th 2019, 12:37 |
rsteenge |
How can i active the DebugKit toolbar outside of the local environment? I tried the following command in my bootstrap.php : Configure::write('DebugKit.forceEnable', true); |
# |
Nov 12th 2019, 12:08 |
tobse |
For a simple language switcher you just need to edit the content of your static pages. Use the language functions and define the locale like described here. https://book.cakephp.org/3/en/core-libraries/internationalization-and-localization.html#changing-the-locale-at-runtime If you have larger content-blocks you can use switch-case for each language-version in your ctp-file |
# |
Nov 12th 2019, 12:01 |
pieceof |
edit config/routes.php |
# |
Nov 12th 2019, 11:59 |
pieceof |
web ui -> localization L10n, content -> internazionalization i18n |
# |
Nov 12th 2019, 11:55 |
massimoi |
Hi, can anybody help me with this simple problem. I'm used to CakePHP 2.x and I'm new to CakePHP3. I need a simple thing: I need elements and static pages to be in different languages. In 2.x I edited the path of the page in the PagesController, but new I don't understand how to do it. Can you help? Thanks |
# |
Nov 12th 2019, 11:32 |
development |
Played with it a bit. It's unfortunate that I develop on Windows (no symlinks), but what I wanted to achieve works. Thanks for the quick reply! |
# |
Nov 12th 2019, 11:31 |
slackebot1 |
$validator->isArray('semestershelves') ->requirePresence('semestershelves') ->notEmptyArray('semestershelves', __('Please choose at least one entry.'); ``` Or do I have to run the validation manually before building the entity in the controller? Or put the validation into the associated model? Thanks for any advice. |
# |
Nov 12th 2019, 11:31 |
tobse |
Hi to all, one question about validation of associated models. I'm having a "belongsToMany"-association between "contents" and "semestershelves". "content" belongs to one or many "semestershelves". In my form I have multiple checkboxes of entries of the associated model. What I like to obtain is a validation-error when no checkbox is checked. I tried the following in the default validator of the contents-table: ``` |
# |
Nov 12th 2019, 11:12 |
hmic |
val: remove/disable the behavior |
# |
Nov 12th 2019, 11:02 |
val |
Hi, what is the proper way to remove unnecessary join to i18n table in models that use TranslateBehavior in 3.x when the translation field is not supposed to be retrieved? |
# |
Nov 12th 2019, 10:37 |
jotpe |
Both approaches not working |
# |
Nov 12th 2019, 10:37 |
slackebot1 |
<jotpe> |
# |
Nov 12th 2019, 10:36 |
jotpe |
I tried this: |
# |
Nov 12th 2019, 10:36 |
jotpe |
Anyone knows how to pass cli params to a engine in CakePDF? https://github.com/FriendsOfCake/CakePdf#configuration |
# |
Nov 12th 2019, 10:27 |
development |
Didn't know about the symlink option. I will try that, thanks! |
# |
Nov 12th 2019, 10:26 |
challgren |
Have you tried https://book.cakephp.org/3/en/console-and-shells/plugin-shell.html#plugin-assets |