/** * get authorize url * * @param string $datasource */ public function authorize_url($datasource = null) { Configure::write('debug', 0); $this->layout = 'ajax'; // -- set datasource $this->Twitter->setTwitterSource($datasource); // set Authorize Url $this->set('url', $this->Twitter->getAuthorizeUrl(null, true)); }
/** * get authorize url * * @param string $datasource */ public function authorize_url($datasource = null) { Configure::write('debug', 0); // -- set datasource $this->Twitter->setTwitterSource($datasource); // set Authorize Url $url = $this->Twitter->getAuthorizeUrl(null, true); echo json_encode(compact('url')); exit; }