有时候我们写了很多行,我们有些不想要,我们就需要把他给删除掉
比如如下代码
foreach ($only_index as $c) {
//自动获取
$controller = str_replace('Controller', '', $c);
$controller_path = strtolower($controller);
$route->get($controller_path, $c . '@index');
$route->any($controller_path . '/api/json', ['uses' => $c . '@apiJson']);
if (in_array($c, ['OrderController', 'PayForController'])) {
$route->get($controller_path . '/show/{id}', ['uses' => $c . '@show']);
}
if (in_array($c, ['OrderHandleApiController'])) {
//订单处理
$route->get($controller_path . '/handle/{order_id}/{type}', 'OrderHandleApiController@handle');
$route->post($controller_path . '/handle/post/{order_id}/{type}', 'OrderHandleApiController@handlePost');
}
}
现在我想要去掉这些空行,那么我们只需要配置php code即可

现在我们再执行ctrl+alert+l就可以格式化了。
网友评论