Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
DefaultController.php
1 <?php
2 
4 {
5  public function actionIndex()
6  {
7  $model = new FGForms('search');
8  $this->render('index', array('model'=>$model));
9  }
10 
11  public function actionViewForm($id)
12  {
13  if(count($_POST))
14  {
15 
16  }
17 
18  $this->renderText($this->widget('fg.widgets.form.FGFormWidget', array(
19  'id'=>$id
20  ), true));
21  }
22 
23  public function actionViewJSON($id)
24  {
25  $model = $this->loadModel($id);
26  $this->render('viewjson', array('model'=>$model));
27  }
28 
29  public function loadModel($id)
30  {
31  $model=FGForms::model()->findByPk($id);
32  if($model===null)
33  throw new CHttpException(404, 'The requested form does not exist');
34  return $model;
35  }
36 }