Skip to content

Commit

Permalink
routes fixed manually
Browse files Browse the repository at this point in the history
  • Loading branch information
zeopix committed Sep 10, 2011
1 parent 09512ce commit 9766b12
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 37 deletions.
33 changes: 28 additions & 5 deletions app/config/routing.yml
Expand Up @@ -28,16 +28,39 @@ fos_user_change_password:
prefix: /change-password

#IgaIgaNewsBundle:
# resource: "@IgaNewsBundle/Controller/"
# resource: "@IgaNewsBundle/Controller/UniversityController.ph"
# type: annotation
# prefix: /

IgaUniverseBundle:
resource: "@IgaUniverseBundle/Controller/"
UniversityController:
resource: "@IgaUniverseBundle/Controller/UniversityController.php"
type: annotation
prefix: /

IgaBootstrapBundle:
resource: "@IgaBootstrapBundle/Controller/"
GradeController:
resource: "@IgaUniverseBundle/Controller/GradeController.php"
type: annotation
prefix: /

Career:
resource: "@IgaUniverseBundle/Controller/CareerController.php"
type: annotation
prefix: /

FileTypeController:
resource: "@IgaUniverseBundle/Controller/FileTypeController.php"
type: annotation
prefix: /


DefaultController:
resource: "@IgaUniverseBundle/Controller/DefaultController.php"
type: annotation
prefix: /


SubjectController:
resource: "@IgaUniverseBundle/Controller/SubjectController.php"
type: annotation
prefix: /

39 changes: 7 additions & 32 deletions src/Iga/UniverseBundle/Controller/SubjectController.php
Expand Up @@ -53,37 +53,12 @@ public function assignaturesAction()
));
}

/**
*
* @Route("/{slug}", name="career_subjects")
*/
public function careerSubjectsAction($slug)
{
//list careers
$em = $this->getDoctrine()->getEntityManager();

$career = $em->getRepository('IgaUniverseBundle:Career')->findOneBySlug($slug);

$entities = $em->createQuery('SELECT s FROM IgaUniverseBundle:Subject s WHERE s.career = :career')
->setParameter('career',$career->getId())
->getResult();

//$entities = $em->getRepository('IgaUniverseBundle:Subject')->findBy(Array('career'=>$career->getId()));

//add subject
$entity = new Subject();
$entity->setCareer($career);
$form = $this->createForm(new SubjectType(), $entity);


return $this->render('IgaUniverseBundle:Subject:career.html.twig',array(
'entities' => $entities,
'entity' => $entity,
'form' => $form->createView(),
'active' => $slug
));
}

/**
* @Route("/{subjectid}", name="followSubject")
*/
public function followSubjectAction($subjectid){
return new Response("null");
}

/**
* Creates a new Subject entity.
Expand Down Expand Up @@ -123,7 +98,7 @@ public function createAction($slug)
}

/**
* Creates a new Subject entity.
* Creates a new File entity.
*
* @Route("/{career}/{subject}/sendfile", name="file_create")
* @Method("post")
Expand Down
Empty file.

0 comments on commit 9766b12

Please sign in to comment.