Hi Bana,
I am sorry to disturb you, I was trying to generate the record from DataObject into XML format for using on my flash page.
I have NewsItem as DataObject with following code:
--------------------------------------------------------------
NewsItem.php
-------------------------------------------------------------
class NewsItem extends DataObject {
static $db = array(
'Title' => 'Varchar(255)',
'Details' => 'HTMLText',
'Source' => 'Varchar(255)',
'Date' => 'Date'
);
static $has_one = array(
'NewsPage' => 'NewsPage',
'NewsPhoto' => 'Image'
);
static $summary_fields = array(
'Title' => 'Title',
'Source' => 'Source',
'Date' => 'Date'
);
public function getCMSFields() {
return new FieldSet(
new TextField('Title'),
new SimpleTinyMCEField('Details', 'News Details'),
new TextField('Source', 'News Source'),
new DatePickerField('Date', 'Release Date'),
new ImageField('NewsPhoto', 'Photo', Null, Null, Null, 'Uploads/latest-news/photos/')
);
}
function caView() {
return true;
}
//Return the Name as a menu title
public function MenuTitle() {
return $this->Title;
}
public function Link() {
if ($NewsPage = $this->NewsPage()) {
return $NewsPage->Link('show/') . $this->ID;
}
}
public function LinkingMode() {
if ($Controller = Controller::CurrentPage() && Controller::CurrentPage()->ClassName == 'NewsPage') {
if (Controller::CurrentPage()->getAction() == 'show' && $NewsItem = Controller::CurrentPage()->getNewsItem()) {
return ($NewsItem->ID == $this->ID) ? 'current' : 'link';
}
}
}
}
----------------------------
my purpose i would like to generate all record from this DataObject into XML Format, you have any example, I am trying many way but it return 404 error.
Your replies I really appreciated.
Bunheng