我有这个实体
article
Acme\DemoBundle\Entity\Article:
type: entity
table: articles
id:
id:
type: integer
id: true
generator:
strategy: AUTO
lifecycleCallbacks: { }
fields:
title:
type: string
length: 64
code:
type: string
length: 16
slug:
type: string
length: 128
gedmo:
slug:
separator: _
style: camel
fields:
- title
indexes:
search_idx:
columns: slug
当我尝试坚持像
这样的新文章时public function newAction()
{
$article = new Article();
$article->setTitle('A new Article');
$article->setCode('my code');
$em = $this->getDoctrine()->getManager();
$em->persist($article);
$em->flush();
return new Response('generated article ' . $article->getId());
}
一切都按预期工作。
但如果标题包含äöü(大写或小写)字符,则表示有点奇怪。
例如,如果我
$article->setTitle('A new Ärticle');
这个slu is是“A-New-Rticle”(如预期的那样),但标题是“A new”。所以它只是在特殊字符之前剪切字符串。
这对我来说是个大问题,因为我的网站不是英文,标题应该能够包含这些字符。
我该如何解决这个问题?
提前致谢