/** * Render the context match method * * @return integer 1 if context match or 0 */ public function render() { if (isset($this->arguments['alias'])) { return (int) Tx_Contexts_Api_ContextMatcher::getInstance()->matches($this->arguments['alias']); } return 0; }
/** * Context Typoscript Connector * * This function is for usage in Typo3 TypoScript to get match context directly. * * @param string $strContext context alias * * @return boolean True if it matches, false if not */ function user_contexts_matches($strContext) { static $initialized = false; if (!$initialized) { //load and resolve all contexts Tx_Contexts_Context_Container::get()->initMatching(); $initialized = true; } return Tx_Contexts_Api_ContextMatcher::getInstance()->matches($strContext); }
/** * Unsets this instance * * @return void */ public static function clearInstance() { self::$instance = null; }