本文整理匯總了PHP中Illuminate\Support\Arr::prepend方法的典型用法代碼示例。如果您正苦於以下問題:PHP Arr::prepend方法的具體用法?PHP Arr::prepend怎麽用?PHP Arr::prepend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Support\Arr
的用法示例。
在下文中一共展示了Arr::prepend方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: findNamedPathView
/**
* Add support for vendor named path overrides.
*
* @param string $name
* @return string
*/
protected function findNamedPathView($name)
{
list($namespace, $view) = $this->getNamespaceSegments($name);
$namespaceOverrides = $this->themeEngine->config('namespace-overrides', []);
if (in_array($namespace, array_keys($namespaceOverrides))) {
if ($namespaceOverrides[$namespace] === '') {
$vendorPath = $this->paths[0];
} else {
$vendorPath = $this->paths[0] . DIRECTORY_SEPARATOR . $namespaceOverrides[$namespace];
}
}
if (!isset($vendorPath) || !$this->files->isDirectory($vendorPath)) {
$vendorPath = $this->paths[0] . '/vendor/' . $namespace;
}
$hints = $this->hints[$namespace];
if (!in_array($vendorPath, $hints) && $this->files->isDirectory($vendorPath)) {
$this->hints[$namespace] = Arr::prepend($hints, $vendorPath);
}
return $this->findInPaths($view, $this->hints[$namespace]);
}
示例2:
/**
* Push an item onto the beginning of an array.
*
* @param array $array
* @param mixed $value
* @param mixed $key
* @return array
*/
function array_prepend($array, $value, $key = null)
{
return Arr::prepend($array, $value, $key);
}
示例3: prepend
/**
* Push an item onto the beginning of the collection.
*
* @param mixed $value
* @param mixed $key
* @return $this
*/
public function prepend($value, $key = null)
{
$this->items = Arr::prepend($this->items, $value, $key);
return $this;
}
示例4: prependOption
public function prependOption($value, $label)
{
$this->options = Arr::prepend($this->options, $label, $value);
return $this;
}