Classes/Controller/AbstractController.php
protected function getContext( $templatePath = 'client/html/templates', $withView = true )
	{
		$config = Base::getConfig( (array) $this->settings );

		if( !isset( self::$context ) )
		{
			$context = Base::getContext( $config );
			$locale = Base::getLocale( $context, $this->request );
			$context->setI18n( Base::getI18n( array( $locale->getLanguageId() ), $config->get( 'i18n', array() ) ) );
			$context->setLocale( $locale );

			self::$context = $context;
		}

		// Use plugin specific configuration
		self::$context->setConfig( $config );

		if( $withView === true )
		{
			$langid = self::$context->getLocale()->getLanguageId();
			$paths = self::$aimeos->getCustomPaths( $templatePath );
			$view = Base::getView( self::$context, $this->uriBuilder, $paths, $this->request, $langid );

			self::$context->setView( $view );
		}

		return self::$context;
	}
protected function getContext( $templatePath = 'client/html/templates', $withView = true )
	{
		$config = Base::getConfig( (array) $this->settings );

		if( !isset( self::$context ) )
		{
			$context = Base::getContext( $config );
			$locale = Base::getLocale( $context, $this->request );
			$context->setI18n( Base::getI18n( array( $locale->getLanguageId() ), $config->get( 'i18n', array() ) ) );
			$context->setLocale( $locale );

			self::$context = $context;
		}

		// Use plugin specific configuration
		self::$context->setConfig( $config );

		if( $withView === true )
		{
			$langid = self::$context->getLocale()->getLanguageId();
			$paths = self::$aimeos->getCustomPaths( $templatePath );
			$view = Base::getView( self::$context, $this->uriBuilder, $paths, $this->request, $langid );

			self::$context->setView( $view );
		}

		return self::$context;
	}
protected function getContext ( $ templatePath = 'client/html/templates' , $ withView = true ) { $ config = Base :: getConfig ( ( array ) $ this -> settings ) ; if ( ! isset ( self :: $ context ) ) { $ context = Base :: getContext ( $ config ) ; $ locale = Base :: getLocale ( $ context , $ this -> request ) ; $ context -> setI18n ( Base :: getI18n ( array ( $ locale -> getLanguageId ( ) ) , $ config -> get ( 'i18n' , array ( ) ) ) ) ; $ context -> setLocale ( $ locale ) ; self :: $ context = $ context ; } // Use plugin specific configuration self :: $ context -> setConfig ( $ config ) ; if ( $ withView === true ) { $ langid = self :: $ context -> getLocale ( ) -> getLanguageId ( ) ; $ paths = self :: $ aimeos -> getCustomPaths ( $ templatePath ) ; $ view = Base :: getView ( self :: $ context , $ this -> uriBuilder , $ paths , $ this -> request , $ langid ) ; self :: $ context -> setView ( $ view ) ; } return self :: $ context ; }
Returns the context item for the frontend

@param string $templatePath Path for retrieving the template paths used in the view
@param boolean $withView True to add view to context object, false for no view
@return \Aimeos\MShop\Context\Item\Iface Context item
Returns the context item for the frontend