Hey guys,
I followed the "Extending Silverstripe" Tutorial and created an additional page type - CustomPage.
I put the CustomPage.php file in the mysite/code folder with the following:
<?php
/**
*/
class CustomPage extends Page {
static $db = array(
);
static $has_one = array(
);
}
class CustomPage_Controller extends Page_Controller {
function showstuff(){
echo "hi!";
}
}
?>
I put a simple echo statement in my new function "showstuff()" to test with.
Then I added CustomPage.ss to the template/layout folder, and it contains:
$showstuff
But the problem is, "Hi!" is displayed ABOVE anything else on the page (header, content divs, etc.).
If I put some text inside the CustomPage.ss file, it displays in the correct content portion of the page. So for some reason when it calls the function it seems to lose where it is on the page.