# |
Dec 28th 2018, 06:49 |
nayakvradhit |
I am getting users controller could not be found |
# |
Dec 28th 2018, 06:40 |
chinpei215 |
if the login URL is http://example.localhost/users/login , can you access the page directly via your browser? |
# |
Dec 28th 2018, 06:38 |
nayakvradhit |
Sorry I did not get you |
# |
Dec 28th 2018, 06:34 |
chinpei215 |
Can you access the login action directly? |
# |
Dec 28th 2018, 06:33 |
nayakvradhit |
My $loginaction contains controller pointing to users and action pointing to login |
# |
Dec 28th 2018, 06:25 |
chinpei215 |
what is the controller/action of the login action? if it is not users/login you need to setup AuthComponent probably to tell where login page is to the component. Otherwise AuthComponent will redirect your request as it think the requested action (your login action) is only allowed for logged in users |
# |
Dec 28th 2018, 05:51 |
nayakvradhit |
I can see the form data uname and pwd in developer tool |
# |
Dec 28th 2018, 05:49 |
nayakvradhit |
It should go to home page |
# |
Dec 28th 2018, 05:37 |
chinpei215 |
Ok. 302 is not an error. it will not be logged to error.log. what is the expected behavior when you click login? |
# |
Dec 28th 2018, 05:33 |
nayakvradhit |
Ok thanks i am getting post 302 when I click login |
# |
Dec 28th 2018, 05:30 |
chinpei215 |
oh are you using Windows? then you don't need to change permission. If you can't see any errors in the file, the no errors have occurred in CakePHP at least. |
# |
Dec 28th 2018, 05:14 |
nayakvradhit |
How to change the permissions in windows any idea ?? For this log file |
# |
Dec 28th 2018, 05:12 |
chinpei215 |
if the file permission is set properly, errors will be logged to the file. |
# |
Dec 28th 2018, 04:21 |
nayakvradhit |
I saw in log folder error.log I cannot find any errors in that ?? |
# |
Dec 28th 2018, 03:32 |
chinpei215 |
if it is not created then you need to set the permission properly. See https://book.cakephp.org/2.0/en/installation.html#permissions |
# |
Dec 28th 2018, 03:30 |
chinpei215 |
I think you can find it in tmp/logs folder of your cakephp application. |
# |
Dec 28th 2018, 03:04 |
nayakvradhit |
Hi can you please tell me how to create a log file to check the errors in cakephp 2.10 |
# |
Dec 28th 2018, 00:02 |
itmpls |
and plan_activities[0][id] = '0'; etc |
# |
Dec 28th 2018, 00:02 |
itmpls |
which generates to be plan_activities[0][estimated_cost] |
# |
Dec 28th 2018, 00:01 |
itmpls |
$this->Form->control('plan_activities.0.estimated_cost') this just ends up being appended?? i even tried re-specifying the id via plan_activities.0.id and a value of its id |
# |
Dec 27th 2018, 23:55 |
itmpls |
it seems to create new rows, wtf? even though i have the id in there? |
# |
Dec 27th 2018, 23:55 |
itmpls |
hm yeah |
# |
Dec 27th 2018, 23:43 |
dereuromark |
@birdy247 I did the test for you, but you can approve the PR if it works as expected. |
# |
Dec 27th 2018, 23:25 |
itmpls |
although i am precreating them with an event, but curious if there was a strategy for that scenario |
# |
Dec 27th 2018, 23:25 |
itmpls |
btw, what key/index do you use if it's new? |
# |
Dec 27th 2018, 23:24 |
itmpls |
sec lemme rule smth out |
# |
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/ |