using the tutorial code as an example, is it possible to call a function from an include file on
/**
* Defines the HomePage page type
*/
class HomePage extends Page {
static $db = array(
);
static $has_one = array(
);
}
class HomePage_Controller extends Page_Controller {
function LatestNews() {
include('FunctionLatestNews.php')
}
}
?>
where FunctionLatestNews.php contains the following code:
$news = DataObject::get_one("ArticleHolder");
return ($news) ? DataObject::get("ArticlePage", "ParentID = $news->ID", "Date DESC", "", 5) : false;
just thinking where this code could be reused on other page controllers.