示例#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
 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
 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
 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
 /**
  *
  * 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;
 }