common/models/entities/Template.php
public static function findActiveByType( $type, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;

		if( static::isMultiSite() && !$ignoreSite ) {

			$siteId	= isset( $config[ 'siteId' ] ) ? $config[ 'siteId' ] : Yii::$app->core->siteId;

			return self::queryByType( $type )->andWhere( 'active=:active AND siteId=:siteId', [ ':active' => true, ':siteId' => $siteId ] )->all();
		}
		else {

			return self::queryByType( $type )->andWhere( 'active=:active', [ ':active' => true ] )->all();
		}
	}
public static function findActiveByType( $type, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;

		if( static::isMultiSite() && !$ignoreSite ) {

			$siteId	= isset( $config[ 'siteId' ] ) ? $config[ 'siteId' ] : Yii::$app->core->siteId;

			return self::queryByType( $type )->andWhere( 'active=:active AND siteId=:siteId', [ ':active' => true, ':siteId' => $siteId ] )->all();
		}
		else {

			return self::queryByType( $type )->andWhere( 'active=:active', [ ':active' => true ] )->all();
		}
	}
public static function findActiveByType ( $ type , $ config = [ ] ) { $ ignoreSite = isset ( $ config [ 'ignoreSite' ] ) ? $ config [ 'ignoreSite' ] : false ; if ( static :: isMultiSite ( ) && ! $ ignoreSite ) { $ siteId = isset ( $ config [ 'siteId' ] ) ? $ config [ 'siteId' ] : Yii :: $ app -> core -> siteId ; return self :: queryByType ( $ type ) -> andWhere ( 'active=:active AND siteId=:siteId' , [ ':active' => true , ':siteId' => $ siteId ] ) -> all ( ) ; } else { return self :: queryByType ( $ type ) -> andWhere ( 'active=:active' , [ ':active' => true ] ) -> all ( ) ; } }
Find and return the active templates for given type.

@param string $type
@param array $config
@return Template[]
Find and return the active templates for given type .