where to define constants in cakephp

后端 未结 3 1982
故里飘歌
故里飘歌 2021-02-07 09:14

In which file should I define application-wide constants that are specific to my cakephp app?

3条回答
  •  情深已故
    2021-02-07 09:52

    I define them in app/config/bootstrap.php

    Bootstrapping CakePHP

    If you have any additional configuration needs, use CakePHP’s bootstrap file, found in app/Config/bootstrap.php. This file is executed just after CakePHP’s core bootstrapping.

    This file is ideal for a number of common bootstrapping tasks:

    1. Defining convenience functions.
    2. Registering global constants.
    3. Defining additional model, view, and controller paths.
    4. Creating cache configurations.
    5. Configuring inflections.
    6. Loading configuration files.

    Complete manual goes here

提交回复
热议问题