$url = 'http://www.mywebsite.com/mypage.html'; $data = \Request::forge($url, 'curl')->execute()->response();
One instantiated you can use set_option() to define curl options:Muzikman wrote on Sunday 15th of July 2012:Ahh.... Makes perfect sense. How would I go about adding curl constant, etc? Through an array of params?
// example from the login method $this->set_option(CURLOPT_USERPWD, $username . ':' . $password);alternatively, you can use set_options() to pass an array of options all at once, and use options() to retrieve set options.
In normal circumstances a forge() returns an instance of itself. In the case of drivers the main class has driver classes, and based on the configuration you pass when you forge an instance you'll get an instance of a specific driver class returned instead of the main class. Take for example Session. It has driver classes for File, DB, Memcached, Redis and cookies, to support the different session storage backend through a unified API.Muzikman wrote on Sunday 15th of July 2012:I am new to the concept of a "driver" when it comes to frameworks. Can you give me a definition in your own words that would help clarify it a bit for me?
Correct. And as Curl and Soap support were a bit of an afterthought they were bolted on later, and the second parameter is "mis-used" to indicate the driver name. This will be addressed in 2.0, we can't change the API of 1.x.Muzikman wrote on Sunday 15th of July 2012:I gotcha. That's why I need to pass the "driver" name of the main class as a parameter to forge. Basically, "forge" an instance of the 'curl" via the main class calling "forge" directly?
Not sure what you mean by this.Muzikman wrote on Sunday 15th of July 2012:Maybe a good "first" project with Fuel would be to use the Fuel core to build the API calls instead of wrapping this native PHP class.
Same here. A module is a (logical separate) part of the application, which contains "front-end" code, like controllers, models and views. A driver is more of a back-end concept for libraries or core classes.Muzikman wrote on Sunday 15th of July 2012:Question: When developing a third party driver or module, is it good practice to get the module operational before implementing the separate controller and model?
It looks like you're new here. If you want to get involved, click one of these buttons!