Category: CakePHP

Cakephp counting occurrence of duplicate values in find();

This is my code:$ids = $this->Match->find('all', array('fields' => array('category_id'), 'conditions' => array('event_id' => $event_id, 'sort > ' => 0, 'finished' => 0, 'create

SOLVED #duplicate
2 Answers
Pidara
Pidara

4

Category: CakePHP

Model fields created and modified are not saved to mysql

Model fields `created` and `modified` should be saved to database on Model.save. Every fields expect for `created` and `modified` are working fine (not null), which should be working on every save or

#save
3 Answers

Category: CakePHP

Upgrade CakePHP from 3.2 to 3.3

I have an application that was built by CakePHP 3.2. I'd like to upgrade to v3.3.{ "name": "cakephp/app", "description": "CakePHP skeleton app", "homepage": "http://cakephp.org", "

SOLVED #composer #upgrade
3 Answers
Lara
Lara

4

Category: CakePHP

Get base_url in controller

I need to fix one of my client's cakephp application (version 2.4). And in most web applications we need base_url to get current path for link building. Now I want to build a link to image so:$base_ur

SOLVED
2 Answers
Pidara
Pidara

4

Category: CakePHP

In Cakephp 3, how to get client's IP address?

Hi,How can I get client's true IP address in Cake 3? $clientIp = $_SERVER['REMOTE_ADDR']; //the php wayI always get output:::1Please help, thanks!

SOLVED #ip
2 Answers

Category: CakePHP

Installing Cakephp 3 without composer?

Hi all,I use Cakephp 2 from time to time, and recently I want to start coding by using version 3. Is there a method to install Cakephp 3 without using composer? I want to install version 3 in an

#composer
2 Answers

Category: CakePHP

Http Client: Failed to open stream: HTTP request failed!

I want to post data to an local API written by Node.js:In Cake's controller:$http = new Client(); $response = $http->post('http://localhost:3000/api/generate', [   'title' => 'This i

SOLVED #http #fopen
3 Answers
Ksmacky
Ksmacky

30

Category: CakePHP

How to use curl requests in Cakephp 3?

Question is how to use curl requests in Cake 3?$ch = curl_init("http://www.foo.com/"); $fp = fopen("example_homepage.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp

SOLVED #curl
1 Answers
Ksmacky
Ksmacky

30

Category: CakePHP

Cakephp 2 how to write data to a downloadable CSV file?

Hi,Is there a built in utility class that is able to generate downloadable CSV file from a php data array in Cakephp 2? Thanks

#csv
1 Answers
Harper
Harper

5

Category: CakePHP

Cakephp 2 how to escape special characters to prevent SQL injection?

Hi, I'd like to know in Cakephp 2 how to escape special characters to prevent SQL injection?For example://input $this->request->data['Model']['name']; // name = 'John "Doe"'I want name fi

SOLVED #sql #injection
3 Answers
Harper
Harper

5