我有以下问题:
当我在PHPstorm中遇到新行(此行有缩进)并粘贴一些代码时,此代码出现在行的开头.缩进每个粘贴代码真的很烦人.
有什么方法可以配置吗?
是否可以通过某些 DIV 宽度或高度来实现特定的 CSS 样式?
像这样的东西:
@media screen and (max-width: 1024px)
Run Code Online (Sandbox Code Playgroud) 如何使用多个值验证一个输入?我正在使用引导标签输入插件。它返回一个字段中的所有标签。我需要验证这个标签 - 独一无二。首先,我试图将此标签放入数组中,然后在请求中对其进行验证,但仍然没有运气。这是我的请求代码:
public function all()
{
$postData = parent::all();
// checkbox status
if(array_key_exists('keywords', $postData)) {
// put keywords into array
$keywords = explode(',', $postData['keywords']);
$test = [];
$i = 0;
foreach($keywords as $keyword)
{
$test[$i] = $keyword;
$i++;
}
$postData['keywords'] = $test;
}
return $postData;
}
public function rules()
{
$rules = [
'title' => 'required|min:3|unique:subdomain_categories,title|unique:subdomain_keywords,keyword',
'description' => '',
'image' => 'required|image',
'keywords.*' => 'min:3'
];
return $rules;
}
Run Code Online (Sandbox Code Playgroud)
但是一旦关键字无效,我就会收到此错误:
helpers.php 第 531 行中的 ErrorException: htmlentities() 期望参数 1 为字符串,给定数组。 …
我已经阅读了谷歌地图API计算距离的一些问题,但仍然不适合我.这是我的代码:
function initMap() {
var loc1 = new google.maps.LatLng(37.772323, -122.214897);
var loc2 = new google.maps.LatLng(34.1633766,-81.6487862);
console.log(google.maps.geometry.spherical.computeDistanceBetween(loc1,loc2));
}
Run Code Online (Sandbox Code Playgroud)
这就是我调用库的方式:
<script src="https://maps.googleapis.com/maps/api/js?libraries=geometry,places&key=MY_KEY&libraries=places&callback=initMap" async defer></script>
Run Code Online (Sandbox Code Playgroud)
但我仍然得到错误:未捕获TypeError:无法在initMap读取未定义的属性'sphere'
我做错了什么?我是否必须启用一些自定义API?
我正在尝试在Ubuntu 16.04上运行主管。安装没有问题。我创建了文件/etc/supervisor/conf.d/test.conf
[program:test]
process_name=%(program_name)s_%(process_num)02d
command=php /data/web/test.com/web/artisan queue:work --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=forge
numprocs=8
redirect_stderr=true
stdout_logfile=/data/web/test.com/web/storage/logs/workers.log
Run Code Online (Sandbox Code Playgroud)
但是当我运行命令
supervisorctl reread
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
错误:CANT_REREAD:“ program:test”部分中的无效用户名伪造(文件:“ / etc / supervisor / conf.d / test.conf”)
任何想法有什么问题吗?试图寻找解决方案,但仍然无法正常工作...
api ×1
arrays ×1
css ×1
distance ×1
indentation ×1
javascript ×1
laravel ×1
laravel-5 ×1
maps ×1
paste ×1
php ×1
phpstorm ×1
supervisord ×1
ubuntu ×1
validation ×1