第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

FileViewFinder-2.php

標(biāo)簽:
PHP

/**

     * Get the path to a template with a named path.

     *

     * @param  string  $name

     * @return string

     */

    protected function findNamedPathView($name)

    {

        list($namespace, $view) = $this->getNamespaceSegments($name);// get this namespace and view

 

        return $this->findInPaths($view, $this->hints[$namespace]);// findInPaths

    }// Get the path to a template with a named path

 

    /**

     * Get the segments of a template with a named path.

     *

     * @param  string  $name

     * @return array

     *

     * @throws \InvalidArgumentException

     */

    protected function getNamespaceSegments($name)

    {// Get the segments of a template with a named path.

        $segments = explode(static::HINT_PATH_DELIMITER, $name);// get a segments

       // in this segments

 

        if (count($segments) != 2) {

            throw new InvalidArgumentException("View [$name] has an invalid name.");

        }// if the result not like as we think, so threw exception

 

        if (! isset($this->hints[$segments[0]])) {

            throw new InvalidArgumentException("No hint path defined for [{$segments[0]}].");

        }// if no hints , we will throw Exception

 

        return $segments;// return segments

    }

 

    /**

     * Find the given view in the list of paths.

     *

     * @param  string  $name

     * @param  array   $paths

     * @return string

     *

     * @throws \InvalidArgumentException

     */

    protected function findInPaths($name, $paths)

    {//Find the given view in the list of paths.

        foreach ((array) $paths as $path) {

            foreach ($this->getPossibleViewFiles($name) as $file) {

                if ($this->files->exists($viewPath = $path.'/'.$file)) {

                    return $viewPath;// if find it just return

                }

            }// get Possible View Files

        }// loop path

 

        throw new InvalidArgumentException("View [$name] not found.");// default throw Exception

    }

 

    /**

     * Get an array of possible view files.

     *

     * @param  string  $name

     * @return array

     */

    protected function getPossibleViewFiles($name)

    {//get Possible View Files

        return array_map(function ($extension) use ($name) {

            return str_replace('.', '/', $name).'.'.$extension;

 

        }, $this->extensions);// two powerfull

    }//Get an array of possible view files.

 

    /**

     * Add a location to the finder.

     *

     * @param  string  $location

     * @return void

     */

    public function addLocation($location)

    {

        $this->paths[] = $location;// add location to path

    }//Add a location to the finder

 

    /**

     * Add a namespace hint to the finder.

     *

     * @param  string  $namespace

     * @param  string|array  $hints

     * @return void

     */

    public function addNamespace($namespace, $hints)

    {//add a namespace hint to the finder

        $hints = (array) $hints;// get the array hints

 

        if (isset($this->hints[$namespace])) {

            $hints = array_merge($this->hints[$namespace], $hints);

        }// if it is isset, combine it with new hints

 

        $this->hints[$namespace] = $hints;// then reset it

    }

 

    /**

     * Prepend a namespace hint to the finder.

     *

     * @param  string  $namespace

     * @param  string|array  $hints

     * @return void

     */

    public function prependNamespace($namespace, $hints)

    {//Prepend a namespace hint to the finder.

        $hints = (array) $hints;// get a right hints

 

        if (isset($this->hints[$namespace])) {

            $hints = array_merge($hints, $this->hints[$namespace]);

        }// this is a good way to hints

 

        $this->hints[$namespace] = $hints;// rewrite it

    }

 

    /**

     * Register an extension with the view finder.

     *

     * @param  string  $extension

     * @return void

     */

    public function addExtension($extension)

    {//register an extension with the view finder.

        if (($index = array_search($extension, $this->extensions)) !== false) {

            unset($this->extensions[$index]);

        }// index

 

        array_unshift($this->extensions, $extension);

    }// add function use this system function to add it

 

    /**

     * Returns whether or not the view specify a hint information.

     *

     * @param  string  $name

     * @return bool

     */

    public function hasHintInformation($name)

    {

        return strpos($name, static::HINT_PATH_DELIMITER) > 0;

    }// Returns whether or not the view specify a hint information.

 

    /**

     * Get the filesystem instance.

     *

     * @return \Illuminate\Filesystem\Filesystem

     */

    public function getFilesystem()

    {

        return $this->files;// return files

    }// get the filesystem instance.

 

    /**

     * Get the active view paths.

     *

     * @return array

     */

    public function getPaths()

    {

        return $this->paths;

    }//get paths

 

    /**

     * Get the namespace to file path hints.

     *

     * @return array

     */

    public function getHints()

    {

        return $this->hints;

    }//get hints

 

    /**

     * Get registered extensions.

     *

     * @return array

     */

    public function getExtensions()

    {

        return $this->extensions;

    }// get extensions

}

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消