<p> <?php $this->wikiCode($this->status->completednotes); ?> </p> <?php } if (mb_strlen($this->status->todonotes)) { ?> <h2>Todo</h2> <p> <?php $this->wikiCode($this->status->todonotes); ?> </p> <?php } ?> <?php $view = new CompositeView(); $view->project = $this->project; $view->status = $this->status; $content = $view->render('project/displaystatus.php'); echo $content; ?> </body> </html>
/** * creates the 'status' view of a project. */ public function statusAction() { $project = $this->byId(); $view = new CompositeView(); $projectStatus = $this->_getParam('projectstatus', null); $status = null; if ($projectStatus) { $status = $this->projectService->getStatus($projectStatus); } else { $status = $this->projectService->getProjectStatus($project, $this->_getParam('period', 7)); } $view->project = $project; $view->status = $status; $content = $view->render('project/status.php'); if ($this->_getParam('pdf')) { ini_set('memory_limit', '32M'); include_once "dompdf/dompdf_config.inc.php"; include_once "dompdf/include/dompdf.cls.php"; include_once "dompdf/include/frame_tree.cls.php"; include_once "dompdf/include/stylesheet.cls.php"; include_once "dompdf/include/frame.cls.php"; include_once "dompdf/include/style.cls.php"; include_once "dompdf/include/attribute_translator.cls.php"; include_once "dompdf/include/frame_factory.cls.php"; include_once "dompdf/include/frame_decorator.cls.php"; include_once "dompdf/include/positioner.cls.php"; include_once "dompdf/include/block_positioner.cls.php"; include_once "dompdf/include/block_frame_decorator.cls.php"; include_once "dompdf/include/frame_reflower.cls.php"; include_once "dompdf/include/block_frame_reflower.cls.php"; include_once "dompdf/include/frame_reflower.cls.php"; include_once "dompdf/include/text_frame_reflower.cls.php"; include_once "dompdf/include/canvas_factory.cls.php"; include_once "dompdf/include/canvas.cls.php"; include_once "dompdf/include/abstract_renderer.cls.php"; include_once "dompdf/include/renderer.cls.php"; include_once "dompdf/include/cpdf_adapter.cls.php"; include_once "dompdf/include/font_metrics.cls.php"; include_once "dompdf/include/block_renderer.cls.php"; include_once "dompdf/include/text_renderer.cls.php"; include_once "dompdf/include/image_cache.cls.php"; include_once "dompdf/include/text_frame_decorator.cls.php"; include_once "dompdf/include/inline_positioner.cls.php"; include_once "dompdf/include/page_frame_reflower.cls.php"; include_once "dompdf/include/list_bullet_frame_decorator.cls.php"; include_once "dompdf/include/list_bullet_positioner.cls.php"; include_once "dompdf/include/list_bullet_frame_reflower.cls.php"; include_once "dompdf/include/list_bullet_image_frame_decorator.cls.php"; include_once "dompdf/include/list_bullet_renderer.cls.php"; include_once "dompdf/include/page_frame_decorator.cls.php"; include_once "dompdf/include/table_frame_decorator.cls.php"; include_once "dompdf/include/cellmap.cls.php"; include_once "dompdf/include/table_frame_reflower.cls.php"; include_once "dompdf/include/table_row_frame_decorator.cls.php"; include_once "dompdf/include/null_positioner.cls.php"; include_once "dompdf/include/table_row_frame_reflower.cls.php"; include_once "dompdf/include/table_cell_frame_decorator.cls.php"; include_once "dompdf/include/table_cell_positioner.cls.php"; include_once "dompdf/include/table_cell_frame_reflower.cls.php"; include_once "dompdf/include/table_row_group_frame_decorator.cls.php"; include_once "dompdf/include/table_row_group_frame_reflower.cls.php"; include_once "dompdf/include/table_cell_renderer.cls.php"; include_once "dompdf/include/inline_frame_decorator.cls.php"; include_once "dompdf/include/inline_frame_reflower.cls.php"; include_once "dompdf/include/image_frame_decorator.cls.php"; include_once "dompdf/include/image_frame_reflower.cls.php"; include_once "dompdf/include/inline_renderer.cls.php"; include_once "dompdf/include/image_renderer.cls.php"; include_once "dompdf/include/dompdf_exception.cls.php"; $dompdf = new DOMPDF(); $dompdf->load_html($content); $dompdf->render(); $date = date('Y-m-d'); if ($status->created) { $date = date('Y-m-d', strtotime($status->created)); } $name = $project->title . ' status-' . $date . '.pdf'; $dompdf->stream($name); } else { echo $content; } }
/** * View the expenses for a given user / client */ public function viewAction() { $view = new CompositeView(); $view->addScriptPath('extensions/expenses/views'); $report = $this->byId(null, 'ExpenseReport'); $client = null; $user = null; $expenses = array(); // we either have a fixed report, or we have a dynamic one if ($report) { if (mb_strlen($report->username)) { $expenses = $this->expenseService->getExpenses(array('userreportid=' => $report->id)); $user = $this->userService->getUserByField('username', $report->username); } else { $expenses = $this->expenseService->getExpenses(array('expensereportid=' => $report->id)); $client = $this->clientService->getClient($report->clientid); } $view->start = $report->from; $view->end = $report->to; } else { $client = $this->clientService->getClient($this->_getParam('clientid')); $user = $this->userService->getUserByField('username', $this->_getParam('username')); $view->user = $user; $start = $this->_getParam('start', $this->_getParam('start', $this->calculateDefaultStartDate())); $end = $this->_getParam('end', $this->_getParam('end', $this->calculateDefaultEndDate())); $expenses = $this->expenseService->getDynamicExpenseReport($start, $end, $user, $client); $view->start = $start; $view->end = $end; } $view->expenses = $expenses; $view->client = $client; $view->user = $user; $view->report = $report; $view->mode = $this->_getParam('pdf') ? 'pdf' : 'html'; $content = $view->render('expense/view.php'); if ($this->_getParam('pdf')) { ini_set('memory_limit', '32M'); include_once "dompdf/dompdf_config.inc.php"; include_once "dompdf/include/dompdf.cls.php"; include_once "dompdf/include/frame_tree.cls.php"; include_once "dompdf/include/stylesheet.cls.php"; include_once "dompdf/include/frame.cls.php"; include_once "dompdf/include/style.cls.php"; include_once "dompdf/include/attribute_translator.cls.php"; include_once "dompdf/include/frame_factory.cls.php"; include_once "dompdf/include/frame_decorator.cls.php"; include_once "dompdf/include/positioner.cls.php"; include_once "dompdf/include/block_positioner.cls.php"; include_once "dompdf/include/block_frame_decorator.cls.php"; include_once "dompdf/include/frame_reflower.cls.php"; include_once "dompdf/include/block_frame_reflower.cls.php"; include_once "dompdf/include/frame_reflower.cls.php"; include_once "dompdf/include/text_frame_reflower.cls.php"; include_once "dompdf/include/canvas_factory.cls.php"; include_once "dompdf/include/canvas.cls.php"; include_once "dompdf/include/abstract_renderer.cls.php"; include_once "dompdf/include/renderer.cls.php"; include_once "dompdf/include/cpdf_adapter.cls.php"; include_once "dompdf/include/font_metrics.cls.php"; include_once "dompdf/include/block_renderer.cls.php"; include_once "dompdf/include/text_renderer.cls.php"; include_once "dompdf/include/image_cache.cls.php"; include_once "dompdf/include/text_frame_decorator.cls.php"; include_once "dompdf/include/inline_positioner.cls.php"; include_once "dompdf/include/page_frame_reflower.cls.php"; include_once "dompdf/include/page_frame_decorator.cls.php"; include_once "dompdf/include/table_frame_decorator.cls.php"; include_once "dompdf/include/cellmap.cls.php"; include_once "dompdf/include/table_frame_reflower.cls.php"; include_once "dompdf/include/table_row_frame_decorator.cls.php"; include_once "dompdf/include/null_positioner.cls.php"; include_once "dompdf/include/table_row_frame_reflower.cls.php"; include_once "dompdf/include/table_cell_frame_decorator.cls.php"; include_once "dompdf/include/table_cell_positioner.cls.php"; include_once "dompdf/include/table_cell_frame_reflower.cls.php"; include_once "dompdf/include/table_row_group_frame_decorator.cls.php"; include_once "dompdf/include/table_row_group_frame_reflower.cls.php"; include_once "dompdf/include/table_cell_renderer.cls.php"; include_once "dompdf/include/inline_frame_decorator.cls.php"; include_once "dompdf/include/inline_frame_reflower.cls.php"; include_once "dompdf/include/image_frame_decorator.cls.php"; include_once "dompdf/include/image_frame_reflower.cls.php"; include_once "dompdf/include/inline_renderer.cls.php"; include_once "dompdf/include/image_renderer.cls.php"; include_once "dompdf/include/dompdf_exception.cls.php"; $dompdf = new DOMPDF(); // $dompdf->set_paper('letter', 'landscape'); $dompdf->load_html($content); $dompdf->render(); $name = "expenses-" . date('Y-m-d', strtotime($view->start)) . '-to-' . date('Y-m-d', strtotime($view->end)) . '.pdf'; $dompdf->stream($name); } else { echo $content; } }
<table class="item-table" cellpadding="0" cellspacing="0"> <thead> <tr> <th width="40%">Title</th> <th>Due</th> <th>Assigned To</th> <th>Actions</th> </tr> </thead> <tbody> <?php $taskRowView = new CompositeView('task/task-line-item.php'); foreach ($this->completedTasks as $task) { $taskRowView->task = $task; $taskRowView->project = $this->project; echo $taskRowView->render('null'); } ?> </tbody> </table> <?php $this->pager($this->totalCompleted, $this->taskListSize, $this->completedPagerName, array('#tasks')); ?> </div> <?php } else { ?>
/** * Enter description here... * * @param unknown_type $template * @param unknown_type $model */ public function generateEmail($template, $model) { $view = new CompositeView(); $view->setScriptPath(APP_DIR . '/views/emails'); $view->assign($model); return $view->render($template); }
/** * Render a view * * @param string $view */ protected function renderView($script) { $this->getResponse()->appendBody($this->view->render($script)); }