peterfrench / yii2-curl
A Yii2 component extension for cURL.
Installs: 285
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
pkg:composer/peterfrench/yii2-curl
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2026-01-17 23:44:16 UTC
README
Requirements
- PHP 5.4+
- Yii 2.0.x
- Curl and php-curl installed
Setup instructions
The preferred way to install this extension is through composer.
php composer.phar require --prefer-dist peterfrench/yii2-curl "*"
Once composer installs the extension, include the component in your config file.
'curl' => [ 'class' => 'peterfrench\curl\Curl', 'options' => [ /* curl options */ ], ],
Usage
- to GET a page with default params
$output = Yii::$app->curl->get($url, $params); // output will contain the result of the query // $params - query that'll be appended to the url
- to POST data to a page
$output = Yii::$app->curl->post($url, $data); // $data - data that will be POSTed