I'm a bit of a novice with PHP and silverstripe. I want to reference a file object's URL to pass it onto a form.
Relevant code snippets:
static $db = array(
"TermsAndConditions" => 'HTMLText'
);
static $has_one = array(
'TermsAndConditionsFile' => 'File'
);
And then in the controller:
function CreateForm() {
return new CreateForm($this, 'CreateForm', $this->TermsAndConditions, $this->TermsAndConditionsFile->getURL());
}
I know there is something fundamentally wrong with the '->getURL()' bit, how should I do this instead? Much appreciated if you can help!