Hello. This is my first time using SilverStripe. I'm going through the tutorial and I'm on the browser poll section right now. However, I was trying to add my own thing to try and get the hang of things myself, a small addition.
My view calls this on the homepage:
Results: $ShowResults
In my controller, I have this method (the controller and everything is hooked up correctly since the poll is working):
public function ShowResults()
{
return ($this->request->param('request') == 'yes' ? 'its yes' : 'none');
// return ($this->request->param('request') == 'yes' ? true : false);
}
I was just trying to get something to spit out. No matter if /?request=yes is appended to the url or not, it keeps giving me back the string 'none'. When it should say 'yes' if it's equal to yes.
Any help would be greatly appreciated. Thank you!