# |
May 28th 2021, 18:35 |
etibor |
thank you @ndm that could be almost good |
# |
May 28th 2021, 18:28 |
ndm |
Use the view builder's `setTemplate()` method. |
# |
May 28th 2021, 18:23 |
etibor |
do you have any hint please |
# |
May 28th 2021, 18:23 |
etibor |
@admad |
# |
May 28th 2021, 18:23 |
etibor |
but it does not change |
# |
May 28th 2021, 18:23 |
etibor |
`$this->getController()->viewBuilder()->setOptions([` `'pdfConfig' => [` `'template'=>'pdf_template'` |
# |
May 28th 2021, 18:22 |
etibor |
basically its uses the same as the template name |
# |
May 28th 2021, 18:21 |
etibor |
in cakepdf how can i change the template file for pdf? |
# |
May 28th 2021, 18:21 |
etibor |
hello all |
# |
May 28th 2021, 17:26 |
st.steinkuehler |
Now I understood: the CakeDC plugin is loading the file from `config/` if the config key + value is set...sorry |
# |
May 28th 2021, 17:04 |
st.steinkuehler |
At the moment I do not have an issue. I want to understand. If I have an solution for my needs with your `Application::pluginBootstrap` hint than I can send a PR for the CakeDC documentation... |
# |
May 28th 2021, 17:01 |
st.steinkuehler |
The CakeDC documentation (page "Installation") is clear, becaus it works. But I do not understand why `Configure::load` has not been used and it does not work with `Configure::load('users','Users.config')` |
# |
May 28th 2021, 16:46 |
chris301 |
Thanks mate that's the one I wanted :) |
# |
May 28th 2021, 16:38 |
steinkel |
or send a PR to the file with an example of your issue and how you fixed it, it'll help others in the same situation, thanks! |
# |
May 28th 2021, 16:37 |
steinkel |
we can add that to the documentation for sure! |
# |
May 28th 2021, 16:36 |
st.steinkuehler |
@steinkel OK, I get it, but isn't it documented? Thanks for the hint to override - that's exactly what I wanted and that's why I tried to understand the config loading of the CakeDC plugin better. |
# |
May 28th 2021, 16:33 |
slackebot |
more asking on how to group the data together using the Form helper |
# |
May 28th 2021, 16:33 |
tyler.adam.lazenby |
sugggestion request: How would you go about creating a form to with migration from a old data structure to a new one. I had been using users as the "account" but now I need to make it so that accounts are collections of users. Additionally I need to add addresses. Luckily there aren't a lot of users yet, otherwise that will make it harder. We also don't have any users that we currently need to group together. I am |
# |
May 28th 2021, 16:29 |
steinkel |
if you need to override these settings after plugin load, you can use the `Application::pluginBootstrap` method |
# |
May 28th 2021, 16:29 |
steinkel |
that's a way to name an array of files and get them loaded, and merged into the configuration |
# |
May 28th 2021, 16:27 |
st.steinkuehler |
Hello, in the CakeDC User documentation the file "config/users.php" is loaded with this code `Configure::write('Users.config', ['users']);` into the configuration - but I can find anything in the API-Doc or Book about this file loading behavior of `Configure::write`. Can someone explain? Thanks. |
# |
May 28th 2021, 15:18 |
shahways |
Thanks @admad, will do so. Have a nice weekend! |
# |
May 28th 2021, 14:56 |
admad |
Please open an issue on github. |
# |
May 28th 2021, 14:55 |
admad |
@shahways That's a bug with bake. The unique check should be in build rules only not validation. |
# |
May 28th 2021, 14:49 |
st.steinkuehler |
Thanks |
# |
May 28th 2021, 14:48 |
ndm |
Very likely. |
# |
May 28th 2021, 14:40 |
st.steinkuehler |
Hello, I want to add a parameter into a post request comming from the browser before it reaches the plugin controller code. Is a middleware the right place to do this? |
# |
May 28th 2021, 13:55 |
ndm |
`assertEventFiredWith()`? |
# |
May 28th 2021, 13:37 |
chris301 |
hi guys, i’m currently working on something where i have dispatched a custom Event, and would like to assert that the specific event dispatched has the content i expect it to, but am struggling to find a way of searching for the event in the EventList other than using getOffset(). is there a method i haven’t found yet that would allow me to search for a particular event in the event list in tests? |
# |
May 28th 2021, 13:18 |
neon1024 |
there it is |
# |
May 28th 2021, 13:18 |
neon1024 |
https://github.com/cakephp/cakephp/blob/2.10.24/lib/Cake/Routing/Router.php#L65-L71 |
# |
May 28th 2021, 13:17 |
neon1024 |
You could check the Routing class in your project to see if it supports prefixes |
# |
May 28th 2021, 13:17 |
neon1024 |
@rightscoreanalysis It’s been a long time since I used Cake 2, but I think prefixes still existed back then |
# |
May 28th 2021, 12:04 |
etibor |
i thought you were asking the prefixes |
# |
May 28th 2021, 11:27 |
rightscoreanalysis |
damn it - I thought as much. Cake came a long way since then :) |
# |
May 28th 2021, 11:22 |
khalil |
Your best bet would be to create separate "app" folders for each, and make them all use the same cake lib and webroot |
# |
May 28th 2021, 11:21 |
khalil |
@rightscoreanalysis You need namespaces for the structure you're trying to accomplish, so no it's not possible in Cake 2 |
# |
May 28th 2021, 11:08 |
rightscoreanalysis |
I know I am asking a lot here, but anyone know if controllers in sub-folders is possible in Cake2? |
# |
May 28th 2021, 10:33 |
etibor |
i found getExtension function, but dont know how can i use this for getting if page has different extension than php |
# |
May 28th 2021, 10:32 |
etibor |
in cake3 how can i get the current page extension? |
# |
May 28th 2021, 09:41 |
khalil |
I'm not sure about what bake generates, I haven't used it since bake 1.3 so I don't really have any info |