Created
March 10, 2016 21:27
-
-
Save Cheddam/a79a596534e0b35be4f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Page extends SiteTree | |
{ | |
... | |
public function setCustomBackgroundColor($input) | |
{ | |
if (substr($input, 0, 1) == '#') { | |
return $input; | |
} else { | |
return '#' . $input; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment