tp5.0 and constants in the configuration file called template in the controller

Frame profile defined config.php

    'view_replace_str'  =>  [

         '__MEMBER__'=> '/static/member',
         '__uploads__'=>'/static/uploads',

     ]

    'TITLE'=> 'title',

Controller

    $path = config('view_replace_str');

    The acquisition is defined as an array of constants: want to get "__uploads__" constant

     $uploads = config('view_replace_str')['__uploads__'];

    Get 'TITLE'

    $title = config('TITLE');

Template

{$Think.config.TITLE}

Original: https://blog.csdn.net/liumuhao/article/details/80065513

Guess you like

Origin www.cnblogs.com/showcase/p/12033996.html