Removing id from cakphp form action
<form id="RecipeEditForm" method="post" action="/recipes/edit/5">
I need to remove /5 from the form action how can i do. I am using Cakephp 3.
See also questions close to this topic
cakephp allow dot in params passed to an action
I have a function which accepts a bunch of params in the URL. One of the parameters however is an operating system version. So it has the format like: 5.6.02
This seems to not be allowed in cakephp and thus it breaks my function. I have no control over what is passed to the action because it comes from another source, otherwise I guess I could replace the dots with underscores or something.
So my question is, how can I allow this particular function to accept GET parameters even when they contain dots? Thanks
cakephp 2 and mikrotik controller scheduler script
I have a cakephp application which is designed to interface with a mikrotik controller (kind of just a router) which you can schedule to run a script. The script I'm running on the controller basically justs visits a php file with a load of params in the URL.
If I visit the URL in a browser, it works as expected. If I run it in the controller scheduler it doesn't.
To test I've placed the file on a different (non cakephp) domain and when run from the controller scheduler it works fine. So it seems like perhaps cakephp doesn't like requests from a controller like this. Again, when I visit the file in a browser it works just fine. Just the controller doesn't seem to be able to access it.
So I'm wondering if there's something about the cakephp framework which wouldn't allow a request from a controller in this way?
the URL looks like www.mywebsite.com/files/mikrotik.php?param=whatever
Can anyone enlighten me?
EDIT: by the way, the mikrotik file is located in app/webroot/files/mikrotik.php
CakePHP unit testing
I am new to php unit testing and every time I try to learn something it doesn't work as the cakephp documentation
1- Starting with the fixtures : I ran the command
bin/cake bake fixture tablenameand tried to execute the test (which is basically empty) : The table gets deleted from the database (I read that its a normal behavior but its not re-created, I should create It everytimee?)
2- I now want to try how it actually work in the test controller and added a basic function and ran the test to this specific controller. I get the error :
Use of undefined constant CONFIG - assumed 'CONFIG' (this will throw an Error in a future version of PHP) /vendor/cakephp/cakephp/src/Routing/Router.php:1170
How can I fix all this ?