public function AuthcacheFlagFlagFragment::render in Authenticated User Page Caching (Authcache) 7.2
Render and return fragment.
Parameters
string $key: The key for the fragment to be rendered.
var $subject: The result of the loader function for the given key. If no AuthcacheP13nFragmentLoader is associated with this fragment, subject is equal to key.
array $context: Additional run-time per-request context (key-value pairs).
Return value
string Return a string representing the HTML fragment
Overrides AuthcacheP13nFragmentInterface::render
File
- modules/
authcache_flag/ includes/ AuthcacheFlagFlagFragment.inc, line 52 - Defines a personalization fragment for retrieving flags. on a node.
Class
- AuthcacheFlagFlagFragment
- Personalization fragment for retrieving flags.
Code
public function render($entity_id, $flag, $context) {
return $flag
->theme($flag
->is_flagged($entity_id) ? 'unflag' : 'flag', $entity_id);
}