CakePHP 5 get body data of POST request
I am creating a REST API using CakePHP 5. I have a POST function that should receive the data from postman and input it to the database. The problem is I am not receiving the data in the request. The…
I am creating a REST API using CakePHP 5. I have a POST function that should receive the data from postman and input it to the database. The problem is I am not receiving the data in the request. The…
When I try to pass variables to check_holiday_dates_on_application I want them to be surrounded by ' in the site html. This is what my code looks like: 'onchange' => 'return check_holiday_dates_on_application('' . $this->Url->webroot('') . '', '' . $token . '','…
I'm new to PHP and having issue with database.php. Basically i'm trying to retrieve the password to connect the DB from PHP. The password stored in AWS secret Manager and have a code to get the secret. This is working…
In order to effectively use ACL in the system I am currently working on, I would need to send the same 2 URI parameters which are ids of the resources I want to check the users access against. In order…
In my CakePHP 4 project, I have two models with a one-to-many relationship between them: <?php namespace AppModelTable; use CakeORMTable; class ContentsTable extends Table { public function initialize(array $config): void { parent::initialize($config); $this->setTable('contents'); $this->setPrimaryKey('id'); // more relations here $this->belongsTo('ContentTypes', […
In CakePHP there is a built in web server that can be used for development. This can be started with bin/cake server which then serves the application by default on http://localhost:8765 In my case I have an old CakePHP 3.8.13…
I have a varbinary(200) NOT NULL field on a table. Let's say the table is called users and the field is called secret. In CakePHP 3.X, accessing $user->secret; after retrieving one row of the table would give me a string.…
I am developing an app in PHP 7.4 (cakephp 4.4). I am trying to use migrations to properly update my tables using cakephp bake migrations feature, but I have an issue with datetime columns. Here is my code : bin/cake…
I am using CakePHP 4.3. According to the documentation, the option value can be used to set the value of the "value" HTML attribute. Here's my code: <?php foreach ($items as $item) { ?> <?= $this->Form->checkbox('add_' . $item->id, [ 'id'…
I have a form that has to handle some elements as part of an array. echo $this->Form->control('config.sys_file_id', ['type' => 'number']); echo $this->Form->control('click_enlarge', ['type' => 'checkbox']); echo $this->Form->control('config.max_width', ['type' => 'number']); echo $this->Form->control('config.max_height', ['type' => 'number']); echo $this->Form->control('config.fixed_width', ['type' => 'number']);…