Category: Utility Classes

Cakephp generating mongodb-liked objectId (based on time, machine, pid, and counter)?

I am thinking about generating objectId (mongoDB-liked) in Cakephp that based on time, machine, pid, and counter. I need this objectId for creating documents. An objectId is probably:SectionDigitstime

#mongodb #objectid
0 Answers

Category: Utility Classes

How to Hash::extract value from JSON data (utility class)

Accroding to Hash::extract() method, to retrieve data from arrays or object implementing with "Hash Path Syntax". For example:// Common Usage: $users = [ ['id' => 1, 'name' => 'mark']

#hash #extract #json
1 Answers
usabob
usabob

2

Category: Utility Classes

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: Utility Classes

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: Utility Classes

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: Utility Classes

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: Utility Classes

How to implement the built-in mobile detect in Cakephp 3?

I have used mobile detect library (http://mobiledetect.net) before in other php project to determine a request is from a mobile device. Not until recently I noticed Cake 3 has built-in library in boot

SOLVED #mobiledetect #detectors
1 Answers