Call and write variables, forward function in silverstripe



notes for Call and write variables, forward function in silverstripe:

class PageHolder extends Page { static $db = array ( 'uploaded' => 'boolean', ); // create checkerfield here // and set checkerfield on/off from cms public function countUp(){ //$this->uploaded = 1; //$this->uploaded = 0; $this->write(); $this->writeToStage('Stage'); $this->publish("Stage", "Live"); echo $this->uploaded ; } } class PageHolder_Controller extends Page_Controller { public function test(){ $this->countUp(); } } // put $countUp or $test in ss template to call function



Tags:
Veröffentlicht: 12.2014