Using Zend Clases - Help-

Permalink
Hi there, i want to use Zend_Form class inside a concrete block. Is this possible? can someone give me some help?

ty.

 
SkyBlueSofa replied on at Permalink Reply
SkyBlueSofa
I have built a block that uses the Zend http client to get an JSON response. To instanciate that class:
require_once "Zend/Http/Client.php";
$url = "http://somewebsite.com/response.json";
$json_response = new Zend_Http_Client($url);
$json_response->request();
$json = Loader::helper('json');
if ($json_response->getLastResponse()->isError()) {
  die('there was an error getting the response.');
} else {
  $response_body = $json_response->getLastResponse()->getBody();
  $parsed_response = $this->doSomethingWithJSONResponse();
}

You can probably do something similar with Zend Form.

I had to look through the Zend classes to figure out what/how do specifically do things, but it seems pretty straightforward.

I hope this helps.
Mnkras replied on at Permalink Reply
Mnkras
If its in
/concrete/libraries/3rdparty/Zend/
do
Loader::Library('3rdparty/Zend/blah');
instead of the require_once
SnefIT replied on at Permalink Reply
SnefIT
I know, it's an old thread but walking into it right now.

I want to use (some) other Zend Framework libraries (like Zend_Oauth).

I have created a /libraries/3rdparties/Zend directory and added the modules. The Zend_Oauth has some dependecies with Zend_Http and others. How do we handle extra Zend_??? libraries? Is it possible? (also because the zend code uses require_once statements). Does the Zend_Loader have to be used?

Pfewh... Hope someone can help me out ;)