我尝试通过 laravel 安装程序使用laravel new <appname>.
这工作没有问题。一旦我尝试安装,spatie/medialibrary就会出现以下无法解释的错误:
$ composer require "spatie/laravel-medialibrary:^9.0.0"
./composer.json has been updated
Running composer update spatie/laravel-medialibrary
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- spatie/laravel-medialibrary[9.0.0, ..., 9.6.4] require spatie/image ^1.4.0 -> satisfiable by spatie/image[1.4.0, ..., v1.x-dev].
- spatie/image[1.10.0, ..., v1.x-dev] require league/glide ^1.6 -> satisfiable by league/glide[1.6.0, 1.6.1, 1.7.0, 1.x-dev].
- spatie/image[1.7.5, ..., 1.9.0] require league/glide ^1.4 -> satisfiable …Run Code Online (Sandbox Code Playgroud) 这是我的用户类:
<?
require_once(dirname(__FILE__).'/DB.class.php');
require_once(dirname(__FILE__).'/Model.class.php');
class Benutzer extends Model
{
private $id;
private $loginName;
private $loginPassword;
private $eMail;
private $rights;
private $mailchange;
private $name;
private $vorname;
private $matrikelnr;
private $gruppe;
/**
* @TODO PhpDoc
*/
protected function __construct($id = null)
{
if ($id !== null)
$this->load($id);
}
/**
* @TODO PhpDoc
*/
public static function factory($id = null)
{
if ($id !== null && is_integer($id)){
return new Benutzer($id);
} else {
return new Benutzer();
}
}
//getter and setter...
}
Run Code Online (Sandbox Code Playgroud)
这是用户类继承的抽象类: …
我想知道是否有更有效的方法来计算用户的选择:
这是页面上多次选择下拉列表:
<select class="span2 jquery-countable" name="category[7]">
<option></option>
<option value="1">1. vote</option>
<option value="2">2. vote</option>
<option value="3">3. vote</option>
<option value="4">4. vote</option>
</select>
Run Code Online (Sandbox Code Playgroud)
这是我的js计算选择:
$(document).ready(function () {
$('#selected-count').html('You choose ' + getCount() + ' entries');
function getCount() {
prio1 = $('.jquery-countable option:selected[value="1"]').length;
prio2 = $('.jquery-countable option:selected[value="2"]').length;
prio3 = $('.jquery-countable option:selected[value="3"]').length;
prio4 = $('.jquery-countable option:selected[value="4"]').length;
return prio1 + prio2 + prio3 + prio4;
}
$('.jquery-countable').change(function () {
$('.jquery-countable option:selected').each(function () {
$('#selected-count').html('You choose ' + getCount() + ' entries');
})
})
});
Run Code Online (Sandbox Code Playgroud)
我的目标是计算用户所做的非空的所有选择?!
有更有效的方法吗? …