首先,我很抱歉我的英语很差,我是法国人。
当我使用时:
@foreach($product as $productAccept)
<a href="{{route('accept-product', ['id' => $productAccept->id] )}}">Accept</a>
@endforeach
我收到此错误:
致命错误:第5行的C:\ xampp \ htdocs \ www \ MyApplication \ model \ Repository \ AnneeCultureRepository.php中找不到类'Repository \ DefaultRepository'
我使用Composer
安装了Doctrine2文件结构是:
/{!! $productAccept->id !!}
bootstrap.php:
php ./vendor/doctrine/orm/bin/doctrine orm:generate-entities ./model --generate-annotations=true
cli-config.php:
- library
--- intern
----- bootstrap.php
----- cli-config.php
- model
--- Entity
----- AnneeCulture.php
--- Repository
----- AnneeCultureRepository.php
----- DefaultRepository.php
- vendor
AnneeCultureRepository.php:
<?php
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
require_once "vendor/autoload.php";
$paths = array("model");
$isDevMode = true;
// the connection configuration
$dbParams = array(
'driver' => 'pdo_mysql',
'dbname' => 'MyApplicationDb',
'user' => 'root',
'password' => '',
'host' => 'localhost',
'charset' => 'utf8',
'driverOptions' => array( 1002=>'SET NAMES utf8')
);
$config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode, null, null, false);
$entityManager = EntityManager::create($dbParams, $config);
defaultRepository.php
<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;
require_once 'bootstrap.php';
return ConsoleRunner::createHelperSet($entityManager);
我在收到此错误时出错了什么?