# |
Dec 27th 2018, 23:23 |
itmpls |
@xavier83ar yeah I am doing that |
# |
Dec 27th 2018, 22:39 |
xavier83ar |
@dereuromark I've called Application::routes() inside ::bootstrap(), right at the end, and then check if routes had been initialized at the beginning of routes() method, to prevent it from run twice as RoutingMiddleware will call it, and worked ok |
# |
Dec 27th 2018, 21:32 |
xavier83ar |
also remember to create and patch the entity with the 'associated' option key correctly configured in controller |
# |
Dec 27th 2018, 21:30 |
xavier83ar |
you should have something like $this->Form->control('plan_activities.0.estimated_cost') |
# |
Dec 27th 2018, 21:29 |
xavier83ar |
@itmpls checkout this https://book.cakephp.org/3.0/en/views/helpers/form.html#creating-inputs-for-associated-data |
# |
Dec 27th 2018, 18:47 |
itmpls |
i'm trying to generate the Form control but since the new entity has no id/index, not sure what format to use |
# |
Dec 27th 2018, 18:46 |
itmpls |
in PlansTable, $this->hasMany('PlanActivities', ['className' => 'Plans.PlanActivities', 'foreignKey' => 'plan_id']); and plan_activities has 'id', 'plan_id', 'estimated_cost' |
# |
Dec 27th 2018, 18:37 |
itmpls |
i have a model say Plans and a hasMany to PlanActivities via plan_id but the latter table has other columns based on other tables/fks, thus having to create an associative array. i guess i'm not getting the format of the Form->control($format) right when it has to do with newEntities.. anyone have an example of this? trying something like this: $this->Form->control('plan_activities.' . $field . ']) for example |
# |
Dec 27th 2018, 18:13 |
dereuromark |
afaik a::routes() just defines weather those willbe loaded or not, they should still be defined it config |
# |
Dec 27th 2018, 18:03 |
xavier83ar |
is this a bug I should report or it's the expected behavior and Application::routes() isn't intended to replace config/routes.php?? |
# |
Dec 27th 2018, 18:03 |
xavier83ar |
Application::routes() gets called later in the process |
# |
Dec 27th 2018, 18:03 |
xavier83ar |
but this way it only includes routes.php file, and do not call Application::routes() |
# |
Dec 27th 2018, 18:03 |
xavier83ar |
I was following code and I found that Router tries to initialize and _loadRoutes() if it's not initialized when you call ::url() method |
# |
Dec 27th 2018, 18:02 |
xavier83ar |
I'm having an issue with routes, when setting up middlewares, I need to build a route, a named one. If this route is declared on routes.php file, it's found and there is no problem, but if I move the declaration to Application::routes() raises a Missing Route exception |
# |
Dec 27th 2018, 18:02 |
xavier83ar |
I'm using cakephp 3.7 and I'm trying to use more Application::bootstrap() and ::routes() methods, as I like a lot more this approach instead of the flat php files from config/ |
# |
Dec 27th 2018, 16:26 |
dereuromark |
not sure what wipe out means in this case. but feel free to make a PR if there is sth to be improved |
# |
Dec 27th 2018, 16:20 |
dereuromark |
yep, has been designed as very simple, secure and easy to understand/use approach for most basic use cases :slightly_smiling_face: nothing beyond that. depends also if authent or author, the first is just adding into whitelist, so that shouldnt be conflicting. the 2nd might. |
# |
Dec 27th 2018, 16:18 |
mikesmoniker |
@dereuromark - I admittedly haven’t played with TinyAuth much, but it seems like it’s not meant to co-exist with other auth components (i.e. we also already extend `Cake\Auth\BaseAuthenticate` to build 2FA on top of Cake’s standard auth, and enabling the plugin wipes that out. Am I missing something obvious? |
# |
Dec 27th 2018, 12:57 |
dereuromark |
PR it against that one and I can merge |
# |
Dec 27th 2018, 12:57 |
birdy247 |
:+1: |
# |
Dec 27th 2018, 12:55 |
dereuromark |
You can provide a test case for https://github.com/cakephp/cakephp/pull/12849 - maybe that speeds it up. |
# |
Dec 27th 2018, 12:49 |
dereuromark |
normal urls have _host and _scheme option, so should asset ones IMO |
# |
Dec 27th 2018, 12:47 |
dereuromark |
maybe you can provide a PR to enhance the core here? |
# |
Dec 27th 2018, 12:47 |
birdy247 |
and then revert it |
# |
Dec 27th 2018, 12:46 |
dereuromark |
4 years ago I already did that for similar reasons ( https://www.dereuromark.de/2014/04/08/generating-pdfs-with-cakephp/#urls-and-paths ) its not supercool to exchange this at runtime for each url, but it would work. |
# |
Dec 27th 2018, 12:46 |
birdy247 |
For now, I will set the fullBaseUrl |
# |
Dec 27th 2018, 12:45 |
dereuromark |
did you look into the url helper source code? doing that reveals that there is no other option so far. unless you extend the UrlHelper and assetUrl() method for this |
# |
Dec 27th 2018, 12:45 |
birdy247 |
Yes |
# |
Dec 27th 2018, 12:43 |
dereuromark |
how do you generate the URL? inside the helper in the email? |
# |
Dec 27th 2018, 12:40 |
birdy247 |
I can only think to solve it by setting Router::setFull.... before and after sending the email |
# |
Dec 27th 2018, 12:39 |
birdy247 |
My issue is rending an image from an email sent from a queue task |
# |
Dec 27th 2018, 12:39 |
birdy247 |
but host or _host doesnt |
# |
Dec 27th 2018, 12:39 |
birdy247 |
fullBase works |
# |
Dec 27th 2018, 12:33 |
dereuromark |
as cdn is a common thing |
# |
Dec 27th 2018, 12:33 |
dereuromark |
pretty sure it is |
# |
Dec 27th 2018, 12:31 |
birdy247 |
similar to links? |
# |
Dec 27th 2018, 12:31 |
birdy247 |
Is it possible to set a host for images |
# |
Dec 27th 2018, 12:31 |
birdy247 |
Hi |
# |
Dec 27th 2018, 10:40 |
doomsday_ |
okie dokie. |
# |
Dec 27th 2018, 10:40 |
challgren |
But hold off on the plugins until you get a bit familiar |
# |
Dec 27th 2018, 10:39 |
challgren |
There are also a lot of awesome plugins that can be found at https://github.com/FriendsOfCake/awesome-cakephp |