本文整理汇总了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;
}