开发者

cakephp work with xml

how work with xml class in cakePHP 1.3?

I have this code:

function xml_test()
{

 echo $this->Xml->header(array('version'=>'1.1'));
 echo $this->Xml->serialize($data, array('format' => 'tags');
}

and get error:

Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the 开发者_JAVA技巧right syntax to use near 'header' at line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 684]

Why, whats wrong?

Query: header 


This is probably because you haven't included the Xml helper in your controller, e.g.

class PostsController extends AppController {
.
.
    var $helpers = array('Xml');
.
.
}


There is a SQL query somehow connected to the value "header" anywhere else but not in your example code which breaks the SQL syntax.

Search for "header" or check if any parameter is set to "header".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜