framework/web/CompositeUrlRule.php
protected function iterateRules($rules, $manager, $route, $params)
    {
        /* @var $rule UrlRule */
        foreach ($rules as $rule) {
            $url = $rule->createUrl($manager, $route, $params);
            if ($url !== false) {
                $this->createStatus = UrlRule::CREATE_STATUS_SUCCESS;
                return $url;
            }
            if (
                $this->createStatus === null
                || !method_exists($rule, 'getCreateUrlStatus')
                || $rule->getCreateUrlStatus() === null
            ) {
                $this->createStatus = null;
            } else {
                $this->createStatus |= $rule->getCreateUrlStatus();
            }
        }

        return false;
    }
protected function iterateRules($rules, $manager, $route, $params)
    {
        /* @var $rule UrlRule */
        foreach ($rules as $rule) {
            $url = $rule->createUrl($manager, $route, $params);
            if ($url !== false) {
                $this->createStatus = UrlRule::CREATE_STATUS_SUCCESS;
                return $url;
            }
            if (
                $this->createStatus === null
                || !method_exists($rule, 'getCreateUrlStatus')
                || $rule->getCreateUrlStatus() === null
            ) {
                $this->createStatus = null;
            } else {
                $this->createStatus |= $rule->getCreateUrlStatus();
            }
        }

        return false;
    }
Iterates through specified rules and calls [[createUrl()]] for each of them.

@param UrlRuleInterface[] $rules rules to iterate.
@param UrlManager $manager the URL manager
@param string $route the route. It should not have slashes at the beginning or the end.
@param array $params the parameters
@return bool|string the created URL, or `false` if none of specified rules cannot be used for creating this URL.
@see createUrl()
@since 2.0.12