Last active
December 16, 2015 08:19
-
-
Save sdboyer/5404920 to your computer and use it in GitHub Desktop.
block title getting
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 BlockBase { | |
/** | |
* {@inheritdoc} | |
*/ | |
final public function getTitle() { | |
// Override titles should supersede native title logic. | |
if (isset($this->configuration['label'])) { | |
// @todo tokenization? | |
} | |
else { | |
return $this->doGetTitle(); | |
} | |
} | |
/** | |
* Returns a title for the block based on some native block logic. | |
* | |
* This method is intended for overriding by subclasses in order to provide | |
* their own logic for generating the block title. | |
* | |
* @see BlockBase::getTitle() | |
* | |
* @return string | |
*/ | |
protected function doGetTitle() { | |
// @todo make this abstract instead | |
return ''; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment