Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Event extends DataObject {
- private static $db = array(
- "URL" => 'Text',
- );
- public function getURL() {
- $url = $this->dbObject('URL');
- $urlVal = $url->value;
- if($urlVal === 'http://' || $urlVal === 'https://') {
- return false;
- }
- return $url;
- }
- }
- //EventHolder.ss
- //This errors
- <% if $Event.URL %><p>Event URL: <a href="$Event.URL">$Event.URL</a></p><% end_if %>
- Errors on
- "DataObject->dbObject(URL)
- LiveStreamEvent.php:95"
- //However...
- class Event extends DataObject {
- private static $db = array(
- "URL" => 'Text',
- );
- public function URL() {
- $url = $this->dbObject('URL');
- $urlVal = $url->value;
- if($urlVal === 'http://' || $urlVal === 'https://') {
- return false;
- }
- return $url;
- }
- }
- //EventHolder.ss
- <% if $Event.URL %><p>Event URL: <a href="$Event.URL">$Event.URL</a></p><% end_if %>
- //This works fine BUT the <% if %> still gets triggered even though it returns false.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement