service/models/ContentProvider.php
/**
     * Returns content provider which url_tpl matches given url
     *
     * @param  string $url
     * @return ContentProvider|null
     */
Returns content provider which url_tpl matches given url
@param  string $url
@return ContentProvider|null
Returns content provider which url_tpl matches given url @param string $url @return ContentProvider|null
public static function guessByUrl($url)
    {
        $providers = static::find()->where(['status' => self::STATUS_ACTIVE]);
        foreach ($providers->each() as $provider) {
            if (preg_match('/'.$provider->url_tpl.'/', $url)) {
                return $provider;
            }
        }
        return null;
    }
public static function guessByUrl ( $ url ) { $ providers = static :: find ( ) -> where ( [ 'status' => self :: STATUS_ACTIVE ] ) ; foreach ( $ providers -> each ( ) as $ provider ) { if ( preg_match ( '/' . $ provider -> url_tpl . '/' , $ url ) ) { return $ provider ; } } return null ; }
Returns content provider which url_tpl matches given url
 @param  string $url
 @return ContentProvider|null
Returns content provider which url_tpl matches given url @param string $url @return ContentProvider|null