小编Mar*_*ski的帖子

PrestaShop 1.7 添加新资源和类

我使用以下代码创建了新资源:

class WebserviceRequest extends WebserviceRequestCore {
public static function getResources(){
    $resources = parent::getResources();

    // if you do not have class for your table
    $resources['test'] = array('description' => 'Manage My API', 'specific_management' => true);

    $resources['categoryecommerce'] = array('description' => 'o jacie marcin', 'class' => 'CategoryEcommerce');

    $mp_resource = Hook::exec('addMobikulResources', array('resources' => $resources), null, true, false);
    if (is_array($mp_resource) && count($mp_resource)) {
        foreach ($mp_resource as $new_resources) {
            if (is_array($new_resources) && count($new_resources)) {
                $resources = array_merge($resources, $new_resources);
            }
        }
    }
    ksort($resources);
    return $resources;
}
}
Run Code Online (Sandbox Code Playgroud)

和新班级: …

php prestashop prestashop-1.6 prestashop-1.7

5
推荐指数
1
解决办法
2343
查看次数

标签 统计

php ×1

prestashop ×1

prestashop-1.6 ×1

prestashop-1.7 ×1