thank you majna i new bebi cakephp
before put App::uses('Xml', 'Utility'); in controller class now i see you
exam and try it
it's easy
thank you very much
2012/8/13 majna <[email protected]>
> Try this, and read
> http://book.cakephp.org/2.0/en/core-utility-libraries/xml.html
>
> <?php
> App::uses('Xml', 'Utility');
>
>
> class FeedsController extends AppController {
>
>
> var $feed_url =
> "http://kurinchilamp.**kurinchilion.com/feed<http://kurinchilamp.kurinchilion.com/feed>
> ";
> var $rss_item = array();
>
>
> function read() {
> $parsed_xml = Xml::build($this->feed_url);
>
> // xml to array conversion
> $this->rss_item = Xml::toArray($parsed_xml);
>
> $this->set('data', $this->rss_item['Rss']['Channel']['Item']);
> }
>
> }
>
>
> On Sunday, August 12, 2012 1:02:23 PM UTC+2, suttipong Pratum wrote:
>>
>>
>> i try to read rss feed from http://kurinchilamp.**
>> kurinchilion.com/2009/06/**cakephp-parsing-rss-feed-in-**
>> simple-steps.html<http://kurinchilamp.kurinchilion.com/2009/06/cakephp-parsing-rss-feed-in-simple-steps.html>
>> then error
>>
>> *Error: * Class 'XML' not found
>> *File: * /home/pos/cakeProject/XXX/app/**Controller/FeedsController.php
>> *Line: * 11
>>
>> XMl not found
>>
>>
>> this my controller
>>
>> <?php
>> class FeedsController extends AppController {
>>
>>
>> var $feed_url =
>> "http://kurinchilamp.**kurinchilion.com/feed<http://kurinchilamp.kurinchilion.com/feed>
>> ";
>> var $rss_item = array();
>>
>>
>> function read() {
>> App::import('Xml');
>> $parsed_xml =& new XML($this->feed_url);
>> // xml to array conversion
>> $this->rss_item = $parsed_xml->toArray();
>> $this->set('data', $this->rss_item['Rss']['**Channel']['Item']);
>> }
>> }
>>
>>
>> tell to fix this error .
>>
>>
>> thanl you
>>
> --
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>
--
Sincerely
Noom . 086 688 5686
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.