我对Pyro CMS很开心,我正在尝试使用API_Controller创建RESTful API,但是当我尝试访问它时,它会回复{"status":false,"error":"This API is currently disabled."}
我怎样才能解决这个问题.. :(
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Api extends API_Controller
{
public function __construct()
{
parent::__construct();
}
public function index_get()
{
$this->response( array('test index' => 'My test'), 200 );
exit;
}
public function test_get($arg1 = NULL)
{
$data = array('test' => 'My test');
if (!empty($arg1))
$data['arg1'] = $arg1;
$this->response( $data, 200 );
exit;
}
}
答案 0 :(得分:0)
您必须在PyroCMS后端启用API访问。