我的实体之间有没有关系(Symfony的)连接两个表没有关系
在我的网页的网络,我有两个相关的使用Ajax的下拉列表。对于第一个我有不同的标题,我的表是这样的:标题(title_id,标题)。这是我显示的代码在下拉这是在我的控制器
$title = $em->getRepository('...Bundle:Title')->findAll();
$MesTitle = array();
foreach ($title as $une) {
$MesTitle[ $une->getTitleid() ]= $une->getTitle();
}
$formTitle->add("title", "choice",
array(
"label" => "Title" ,
'empty_value' => 'select your Title',
"choices" =>$MesTitle
)
);
的第二个当用户选择一个标题,我们必须向他展示的标题选择字幕的冠军,为了这个,我有两个表:第一个HasTitle(title_id的,sub_title_id)和第二对字幕(sub_title_id,sub_title)。对于此我使用AJAX,这是我的代码:
$('#title_title').change(function() {
var titleid = $("#title_title option:selected").val();
console.log(titleid);
$.ajax({
type:'get',
url:'http://localhost:.../.../web/app_dev.php/....../',
beforeSend: function(){
console.log('cooll');
},
success: function(data){
console.log(data);
}
});
});
我需要一种方法在我的控制器至极取来自JS(AJAX)的$title_id
,并给我的价值,以便在第二次下拉菜单中显示它们。
我的实体之间有没有关系
谢谢
对不起Symphony是什么? :o – COil
编写_Symphony_而不是_Symfony_是一个常见的错误。另外,[Symphony是现有的CMS](http://www.getsymphony.com/)。 – chalasr
我很抱歉,这是一个错误拼写错误 – user225049