public function & SetHelper ($helperName, & $instance, $forAllTemplates = TRUE) {
		/** @var $this \MvcCore\View */
		$implementsIHelper = FALSE;
		if ($forAllTemplates) {
			if (self::$_toolClass === NULL)
				self::$_toolClass = \MvcCore\Application::GetInstance()->GetToolClass();
			$toolClass = self::$_toolClass;
			$helpersInterface = self::HELPERS_INTERFACE_CLASS_NAME;
			$className = get_class($instance);
			$implementsIHelper = $toolClass::CheckClassInterface($className, $helpersInterface, FALSE, FALSE);
			self::$_globalHelpers[$helperName] = [& $instance, $implementsIHelper];
		}
		$this->__protected['helpers'][$helperName] = & $instance;
		if ($implementsIHelper) $instance->SetView($this);
		return $this;
	}
public function & SetHelper ($helperName, & $instance, $forAllTemplates = TRUE) {
		/** @var $this \MvcCore\View */
		$implementsIHelper = FALSE;
		if ($forAllTemplates) {
			if (self::$_toolClass === NULL)
				self::$_toolClass = \MvcCore\Application::GetInstance()->GetToolClass();
			$toolClass = self::$_toolClass;
			$helpersInterface = self::HELPERS_INTERFACE_CLASS_NAME;
			$className = get_class($instance);
			$implementsIHelper = $toolClass::CheckClassInterface($className, $helpersInterface, FALSE, FALSE);
			self::$_globalHelpers[$helperName] = [& $instance, $implementsIHelper];
		}
		$this->__protected['helpers'][$helperName] = & $instance;
		if ($implementsIHelper) $instance->SetView($this);
		return $this;
	}
public function & SetHelper ( $ helperName , & $ instance , $ forAllTemplates = TRUE ) { /** @var $this \MvcCore\View */ $ implementsIHelper = FALSE ; if ( $ forAllTemplates ) { if ( self :: $ _toolClass === NULL ) self :: $ _toolClass = \ MvcCore \ Application :: GetInstance ( ) -> GetToolClass ( ) ; $ toolClass = self :: $ _toolClass ; $ helpersInterface = self :: HELPERS_INTERFACE_CLASS_NAME ; $ className = get_class ( $ instance ) ; $ implementsIHelper = $ toolClass :: CheckClassInterface ( $ className , $ helpersInterface , FALSE , FALSE ) ; self :: $ _globalHelpers [ $ helperName ] = [ & $ instance , $ implementsIHelper ] ; } $ this -> __protected [ 'helpers' ] [ $ helperName ] = & $ instance ; if ( $ implementsIHelper ) $ instance -> SetView ( $ this ) ; return $ this ; }
Set view helper for current template or for all templates globally by default.
If view helper already exist in global helpers store - it's overwritten.
@param string $helperName View helper method name in pascal case.
@param mixed $instance View helper instance, always as `\MvcCore\Ext\Views\Helpers\AbstractHelper|\MvcCore\Ext\Views\Helpers\IHelper` instance.
@param bool $forAllTemplates register this helper instance for all rendered views in the future.
@return \MvcCore\View|\MvcCore\IView
Set view helper for current template or for all templates globally by default . If view helper already exist in global helpers store - it s overwritten .