当前位置: 首页>>代码示例>>PHP>>正文


PHP application::htmlTable方法代码示例

本文整理汇总了PHP中application::htmlTable方法的典型用法代码示例。如果您正苦于以下问题:PHP application::htmlTable方法的具体用法?PHP application::htmlTable怎么用?PHP application::htmlTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在application的用法示例。


在下文中一共展示了application::htmlTable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: home

 public function home()
 {
     # Start the HTML
     $html = '';
     # Get the list of projects
     if (!($projectsRaw = $this->databaseConnection->select($this->settings['database'], $this->settings['table'], $conditions = "status != 'proposed'", $columns = array(), true, $orderBy = "FIELD(status, 'developing','additional','specced','proposed','completed'), id DESC"))) {
         $html = "\n<p>There are no confirmed projects at present.</p>";
         echo $html;
         return;
     }
     # Attach status string to the key for CSS styling purposes
     $projects = array();
     foreach ($projectsRaw as $id => $project) {
         $key = $id . ' ' . lcfirst($project['status']);
         $projects[$key] = $project;
     }
     # Assemble fields
     foreach ($projects as $id => $project) {
         if ($this->userIsAdministrator) {
             $projects[$id]['id'] = "<a href=\"{$this->baseUrl}/projects/{$project['id']}/edit.html\"><strong>" . $projects[$id]['id'] . '</strong></a>';
         }
         $projects[$id]['name'] = "<a href=\"{$projects[$id]['url']}\" target=\"_blank\">" . htmlspecialchars($projects[$id]['name']) . '</a>';
         unset($projects[$id]['url']);
         $projects[$id]['status'] = ucfirst($projects[$id]['status']);
         unset($projects[$id]['client']);
         $projects[$id]['progress'] = nl2br(htmlspecialchars($projects[$id]['progress']));
     }
     $allowHtml = array('id', 'name', 'progress');
     # Find the earliest date
     $earliestDate = $this->databaseConnection->selectOneField($this->settings['database'], $this->settings['table'], 'finishDate', 'finishDate IS NOT NULL', array(), false, $orderBy = 'finishDate', $limit = 1);
     # Create the HTML
     $html .= "\n<p>The table below shows a list of all confirmed projects" . ($earliestDate ? ' since ' . date('F Y', strtotime($earliestDate . ' 12:00:00')) : '') . '.</p>';
     if ($this->settings['generalHtml']) {
         $html .= "\n<p>This does not include <a href=\"{$this->baseUrl}/general.html\">general, ongoing work</a>.</p>";
     }
     $html .= "\n<p>You can <a href=\"{$this->baseUrl}/add.html\">request a project</a>.</p>";
     $tableHeadingSubstitutions = $this->databaseConnection->getHeadings($this->settings['database'], $this->settings['table']);
     $html .= "\n" . '<!-- Enable table sortability: --><script language="javascript" type="text/javascript" src="/sitetech/sorttable.js"></script>';
     $html .= application::htmlTable($projects, $tableHeadingSubstitutions, 'lines sortable" id="sortable', $keyAsFirstColumn = false, false, $allowHtml, false, false, $addRowKeyClasses = true);
     # Show the HTML
     echo $html;
 }
开发者ID:camunigeog,项目名称:projects-database,代码行数:42,代码来源:projectsDatabase.php


注:本文中的application::htmlTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。