This article will briefly introduce the installation and use of yaml, so that you can understand it.
After the installation is completed, it is simple to use. Create a new kaka.yaml file in the config.
Test yaml data reading
Where did you know this method?
Remember that in the loadFile method under the config class, different methods are loaded according to the file extension.
For the PHP type, set is used directly. For the yaml type, the data is processed into an array and then the set method is executed.
If it is other types, the corresponding class name will be returned in the factory mode mentioned above. instance, and execute the method in the corresponding class to convert the format into an array form. In the end, the set method is still used.
Other types of configuration files will eventually go to the set method.
Persistence in learning, persistence in blogging, and persistence in sharing are the beliefs that Kaka has always upheld since his career. I hope that Kaka’s articles on the huge Internet can bring you a little bit of help. I’m Kaka, see you next time.
The above is the detailed content of ThinkPHP's first experience with yaml. For more information, please follow other related articles on the PHP Chinese website!