Replace the :attribute placeholder in the given message.

@param  string  $message
@param  string  $value
@return string
427026
protected function replaceAttributePlaceholder($message, $value)
    {
        return str_replace(
            [':attribute', ':ATTRIBUTE', ':Attribute'],
            [$value, Str::upper($value), Str::ucfirst($value)],
            $message
        );
    }
1360049
static function Replace($placeholder)
    {
        $args = func_get_args();    
        array_shift($args);
        return self::ReplaceArgsUsing($placeholder, null, $args);
    }
1301055
public function createPlaceholder($value)
    {
        if (($key = array_search($value, $this->all()))) {
            $placeholder = $key;
        } else {
            $placeholder = $this->createUniquePlaceholder();
        }

        $value = $this->removeNestedPlaceholders($value);
        $this->items[$placeholder] = $value;

        return $placeholder;
    }
865492
protected function replaceStartsWith($message, $attribute, $rule, $parameters)
    {
        foreach ($parameters as &$parameter) {
            $parameter = $this->getDisplayableValue($attribute, $parameter);
        }

        return str_replace(':values', implode(', ', $parameters), $message);
    }
1156919
protected function replaceBeforeOrEqual($message, $attribute, $rule, $parameters)
    {
        return $this->replaceBefore($message, $attribute, $rule, $parameters);
    }
1008541
protected function replaceRequiredIf($message, $attribute, $rule, $parameters)
	{
		$parameters[0] = $this->getAttribute($parameters[0]);

		return str_replace(array(':other', ':value'), $parameters, $message);
	}
36435
protected function replaceInArray($message, $attribute, $rule, $parameters)
    {
        return str_replace(':other', $this->getDisplayableAttribute($parameters[0]), $message);
    }
742827
function _makePlaceholder(selector, value) {
  return selector.replace(_replaceRegExp(value), (_, first, last) =>
    `${first}%${_.trim()}${last}`);
}
547768
protected function removeAttributeValue($value, $valueToRemove)
    {
        $valueToRemove = is_array($valueToRemove) ? $valueToRemove : [ $valueToRemove ];

        foreach ($valueToRemove as $remove) {
            if (is_array($value) && (($key = array_search($remove, $value)) !== false)) {
                unset($value[$key]);
            } elseif (!is_array($value) && ($value == $remove)) {
                $value = '';
            }
        }

        return $value;
    }
1323708
public function getValueOrPlaceholder($value, TransactionData $transactiondata)
    {
        return preg_replace_callback(
            '/\{\{\s*(var|uri|get|post|header|cookie|method)(?:\.([a-z0-9-_]+))?\s*\}\}/i',
            function ($matches) use ($transactiondata) {
                return $this->getValueFromPlaceholder(
                    $matches[1],
                    isset($matches[2]) ? $matches[2] : null,
                    $transactiondata
                );
            },
            $value
        );
    }
228999
public function validateValue($value) {

        $model = &$this->_model;

        $attribute = $this->_attributeName;
        if ((!is_array($model->$attribute) || !count($model->$attribute)) && $this->skipOnEmpty) {
            return '';
        }

        $result = count($model->$attribute) > 0;
        $class = $this->baseModel;

        foreach ($model->$attribute as $_key => &$_model) {
            /** @var $_model Model|ActiveRecord */
            if (!is_object($_model)) {
                if (!is_array($_model)) {
                    $_model = [$this->attribute ? : $this->_attributeName => $_model];
                }
                $_model = new $class($_model);
            }

            $result = $_model->validate() && $result;
        }

        return $result || (sizeof($model->$attribute)==1 && $this->skipOnEmpty) ? null : [$this->message, $result];
    }
1286832
protected function attributeHasValue($attribute, $value)
    {
        $attribute = $this->resolveAttributeName($attribute);

        if (is_array($this->attributes[$attribute])) {
            return in_array($value, $this->attributes[$attribute]);
        } else {
            return ($this->attributes[$attribute] == $value);
        }
    }
340808
protected function replaceRequiredUnless($message, $attribute, $rule, $parameters)
    {
        $other = $this->getDisplayableAttribute($parameters[0]);

        $values = [];

        foreach (array_slice($parameters, 1) as $value) {
            $values[] = $this->getDisplayableValue($parameters[0], $value);
        }

        return str_replace([':other', ':values'], [$other, implode(', ', $values)], $message);
    }
816873
public function withAttribute($attribute, $value)
    {
        $new = $this->psrRequest->withAttribute($attribute, $value);
        return new self($new, $this->originalRequest);
    }
814937
protected function replaceLt($message, $attribute, $rule, $parameters)
    {
        if (is_null($value = $this->getValue($parameters[0]))) {
            return str_replace(':value', $parameters[0], $message);
        }

        return str_replace(':value', $this->getSize($attribute, $value), $message);
    }
1324899
public function setAttr($attribute, $value = null)
    {
        if (is_array($attribute) && is_null($value)) {
            foreach ($attribute as $k => $v) {
                $this->setAttr($k, $v);
            }

            return $this;
        }
        $this->template->appendHTML('attributes', ' '.$attribute.'="'.$value.'"');

        return $this;
    }
9412
protected String placeHolderTranslation(String value,
            Map<String,String> metainfo, XmlObject xmlbean) {
        int k, i, n;
        StringBuffer sb = new StringBuffer();
        n = value.length();
        for (i=0; i<n; i++) {
            char ch = value.charAt(i);
            if (ch=='{') {
                k = i+1;
                while (k<n) {
                    ch = value.charAt(k);
                    if (ch=='}') break;
                    k++;
                }
                if (k<n) {
                    String placeHolder = value.substring(i+1,k);
                    String v;
                    if (placeHolder.charAt(0)=='$') {
                        v = metainfo.get(placeHolder.substring(1));
                    } else {        // assume is an XPath expression
                        v = XmlPath.evaluate(xmlbean, placeHolder);
                    }
                    if (v!=null) sb.append(v);
                } // else  '{' without '}' - ignore string after '{'
                i = k;
            } else sb.append(ch);
        }
        return sb.toString();
    }