peterfrench / yii2-curl
A Yii2 component extension for cURL.
Package info
github.com/peterfrench/yii2-curl
Type:yii2-extension
pkg:composer/peterfrench/yii2-curl
1.0.5
2015-04-09 15:57 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2026-04-26 00:53:39 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