2.3升级2.4,发现app目录下的function.php被删了

1.93K 浏览M2交流区magento2.4

2.3升级2.4,发现app目录下的function.php被删了

2.3升级2.4,发现app目录下的function.php被删了.

2.4 用啥搞公用函数

__ 翻译用的函数又是怎么传过去的

这函数之前在functions定义的

已回答
0

基本上不需要公用函数.一般写在自己模块的helper里。

__()这个函数我搜了下,是在这个文件里引入的
vendor/magento/framework/registration.php

等于是模块注册的时候就自动引入了

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::LIBRARY, 'magento/framework', __DIR__);

if (!function_exists('__')) {
    require 'Phrase/__.php';
}
~
已回答
0
您正在查看1个回答中的1个,单击此处查看所有回答。