コード例 #1
0
 public function getAdminFormValue()
 {
     $view = new View(__DIR__ . '/confirmation_code.tpl');
     $view->set('name', $this->fieldName);
     $view->set('value', $this->value);
     return $view->render();
 }
コード例 #2
0
ファイル: HasMany.php プロジェクト: gudwin/extasy
 public function getAdminFormValue()
 {
     $view = new View(__DIR__ . DIRECTORY_SEPARATOR . 'HasMany/admin.tpl');
     $view->set('name', $this->szFieldName);
     $view->set('values', $this->loadLinkedData());
     return $view->render();
 }
コード例 #3
0
ファイル: TimeAccess.php プロジェクト: gudwin/extasy
 public function getAdminFormValue()
 {
     $view = new View(__DIR__ . DIRECTORY_SEPARATOR . 'time_access.tpl');
     $view->set('name', $this->szFieldName);
     $view->set('value', $this->aValue);
     return $view->render();
 }
コード例 #4
0
ファイル: Email.php プロジェクト: gudwin/extasy
 public function getAdminFormValue()
 {
     $view = new View(__DIR__ . '/email.tpl');
     $view->set('name', $this->szFieldName);
     $view->set('value', $this->aValue);
     return $view->render();
 }
コード例 #5
0
ファイル: helperTest.php プロジェクト: gudwin/faid
 public function testGetNameHelper()
 {
     $view = new View($this->viewPath);
     $helper = new basicHelper();
     $view->addHelper($helper, 'CoolName');
     $this->assertEquals($helper, $view->CoolName);
 }
コード例 #6
0
ファイル: Page.php プロジェクト: gudwin/extasy
 public function generate()
 {
     $parseData = \EventController::callFilter(self::EventName, $this->data->getValue());
     $view = new View($this->tpl->getValue());
     $view->addHelper(new ViewHelper());
     $view->set($parseData);
     $content = $view->render();
     $writer = new Writer($this->url->getValue());
     $writer->write($content);
 }
コード例 #7
0
ファイル: Audit.php プロジェクト: gudwin/extasy
 public function main()
 {
     $title = 'Средства аудита';
     $begin = array($title => '#');
     $view = new View(__DIR__ . '/../Views/index.tpl');
     $this->outputHeader($begin, $title);
     print $view->render();
     $this->outputFooter();
     $this->output();
 }
コード例 #8
0
ファイル: basicTest.php プロジェクト: gudwin/faid
 public function testAutoRender()
 {
     //
     $this->expectOutputString(self::ViewParamValue);
     $view = new View($this->viewPath);
     $view->set(self::ViewParamName, self::ViewParamValue);
     //
     $view->set(self::ViewParamName, self::ViewParamValue);
     $controller = new TestController();
     $controller->setView($view);
     $controller->afterAction();
 }
コード例 #9
0
ファイル: View.php プロジェクト: gudwin/faid
 /**
  * @param array $vars
  *
  * @return string
  */
 public function render()
 {
     //
     $this->beforeRender();
     //
     $oldContents = ob_get_contents();
     //
     if (sizeof(ob_list_handlers()) > 0) {
         ob_clean();
     } else {
         ob_start();
     }
     //
     $content = $this->renderFile($this->viewVars, $this->filePath);
     //
     if (!empty($this->layout)) {
         $vars = $this->viewVars;
         $vars['content_for_layout'] = $content;
         $this->layout->set($vars);
         $content = $this->layout->render();
     }
     //
     print $oldContents;
     //
     $this->rendered = true;
     //
     return $content;
 }
コード例 #10
0
ファイル: Controller.php プロジェクト: gudwin/faid
 public function set($key, $value)
 {
     if (!empty($this->view)) {
         $this->view->set($key, $value);
     } else {
         throw new Exception('View not defined');
     }
 }
コード例 #11
0
ファイル: basicTest.php プロジェクト: gudwin/faid
 public function testIsRendered()
 {
     //
     $view = new View($this->viewPath);
     //
     $this->assertFalse($view->isRendered());
     //
     $view->set('msg', 'hello world!');
     //
     $result = $view->render();
     $this->assertTrue($view->isRendered());
 }
コード例 #12
0
ファイル: controller.php プロジェクト: gudwin/extasy
 /**
  *
  * Enter description here ...
  *
  * @param unknown_type $tpl
  */
 public function render($tpl = '')
 {
     ini_set('include_path', VIEW_PATH);
     $tpl = $this->detectTplFileName($tpl);
     $view = new View($tpl);
     $view->setViewVars($this->aParse);
     foreach ($this->viewHelpers as $name => $object) {
         $view->addHelper($object, $name);
     }
     $content = $view->render();
     return $content;
 }