form type da
->add('Il', null, array('label'=>'Il','attr'=>array('class'=>'form-control')))
->add(‘Il’, null, array(‘label’=>’Il’,’attr’=>array(‘class’=>’form-control select2me’)))
new twige ekle
{% block script %}
{% endblock %}
Kontroller a ekle
$em = $this->getDoctrine()->getManager(); kodunun altına ekle
if($request->get(‘ilce’))
{
$ilce = $em->getRepository(‘WebAdminBundle:Ilce’)->find($request->get(‘ilce’));
$otel->setIlce($ilce);
}
if($request->get(‘semt’))
{
$semt = $em->getRepository(‘WebAdminBundle:Semt’)->find($request->get(‘semt’));
$otel->setSemt($semt);
}
if($request->get(‘mahalle’)) {
$mahalle = $em->getRepository(‘WebAdminBundle:Mahalle’)->find($request->get(‘mahalle’));
$otel->setMahalle($mahalle);
}
base.html.twig ekle
getir
new.html.twig form bitişinin başına ekle
edit.twig.html ekle
form_widget altına ekle
Sayfanın en altına
{% block script %}
{% endblock %}