本文整理汇总了PHP中Html::startTag方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::startTag方法的具体用法?PHP Html::startTag怎么用?PHP Html::startTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Html
的用法示例。
在下文中一共展示了Html::startTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getWriteDisplay
/**
* show the data in an input element for editing
*
* @return string
*/
protected function getWriteDisplay()
{
$selectedOptionNames = explode(', ', $this->value);
$output = Html::startTag('div', ['class' => $this->class]);
$connectedClassName = $this->fieldinfo->getConnectedClass();
/** @var BaseConnectionObject $connObj */
$connObj = new $connectedClassName();
$class = $connObj->getOtherClass($this->fieldinfo->getClass());
$obj = Factory::createObject($class);
$connectedFieldName = $this->fieldinfo->getFieldsOfConnectedClass();
$table = DB::table($obj->getTable());
$result = Finder::create($class)->find([$table->getColumn($connectedFieldName), $table->getColumn('LK')]);
foreach ($result as $row) {
$params = [];
$params['value'] = $row['LK'];
$params['type'] = 'checkbox';
$params['class'] = 'checkbox';
$params['name'] = $this->name . '[]';
if (in_array($row[$connectedFieldName], $selectedOptionNames)) {
$params['checked'] = 'checked';
}
$output .= Html::startTag('p') . Html::singleTag('input', $params) . " " . $row[$connectedFieldName] . Html::endTag('p');
}
$output .= Html::endTag('div');
return $output;
}
示例2: display
public function display(OutputDevice $od)
{
$od->addContent(Html::startTag('div', ['class' => 'leftNavigation']));
foreach ($this->getNaviStructure() as $category => $entries) {
$od->addContent(Html::startTag('h3') . $category . Html::endTag('h3'));
$od->addContent(Html::startTag('div'));
$od->addContent(Html::startTag('ul'));
foreach ($entries as $entryName => $url) {
$od->addContent(Html::startTag('li') . Html::url(HTML_ROOT . "/de/acp/$url", $entryName) . Html::endTag('li'));
}
$od->addContent(Html::endTag('ul'));
$od->addContent(Html::endTag('div'));
}
// $od->addContent(Html::startTag('div', ['id' => 'leftNavigation']));
// $od->addContent(Html::startTag('ul', ['id' => 'leftNavigation']));
// foreach ($this->getNaviStructure() as $category => $content) {
// if (is_string($content)) {
// $od->addContent(Html::startTag('li') . Html::url(HTML_ROOT . "/de/acp/$content", $category) . Html::endTag('li'));
// continue;
// }
// $od->addContent(Html::startTag('li') . $category);
// $od->addContent(Html::startTag('ul'));
// foreach ($content as $name => $url) {
// $od->addContent(Html::startTag('li') . Html::url(HTML_ROOT . "/de/acp/$url", $name) . Html::endTag('li'));
// }
// $od->addContent(Html::endTag('ul'));
// $od->addContent(Html::endTag('li'));
// }
// $od->addContent(Html::endTag('ul'));
// $od->addContent('<br style="clear:both" />');
$od->addContent(Html::endTag('div'));
}
示例3: display
/**
* display the header div
*
* @param OutputDevice $od
*/
public function display(OutputDevice $od)
{
$od->addContent(Html::startTag('body'));
$od->addContent(Html::startTag('div', array('class' => 'pageStructure')) . "\n");
$od->addContent(Html::startTag('div', array('class' => $this->getCssClass())) . "\n");
$od->addContent($this->getContent());
$od->addContent(Html::endTag('div'));
}
示例4: startMainContent
/**
* starts the main content section of the page
*
* @param OutputDevice $od
*/
public static function startMainContent(OutputDevice $od)
{
$od->addContent(Html::startTag('div', array('class' => 'mainContent', 'id' => 'mainContent')));
$requestHelper = new RequestHelper();
$ajaxMsg = $requestHelper->getParam('ajaxMsg');
$od->addContent(Html::ajaxMsgDiv($ajaxMsg));
$od->addContent(Html::loaderDiv());
}
示例5: display
/**
* display the footer section of the page
*
* @param OutputDevice $od
*/
public function display(OutputDevice $od)
{
$od->addContent(Html::startTag('div', ['style' => 'clear:both']) . Html::endTag('div'));
$od->addContent(Html::startTag('div', array('class' => $this->getCssClass())));
$od->addContent($this->getContent());
$od->addContent(Html::endTag('div'));
$od->addContent(Html::endTag('div'));
$od->addContent(Html::endTag('body'));
}
示例6: exception_handler
function exception_handler(Exception $exception) {
$div = Html::startTag('div', array('id' => 'exceptionBox'));
$div .= Html::startTag('p', array('class' => 'h3')) . TMS(BaseException::HEADLINE) . Html::endTag('p');
$div .= Html::startTag('hr');
$div .= $exception->getMessage();
$div .= Html::endTag('div');
print($div);
if ($exception instanceof BaseException) {
$exception->debugOut();
}
}
示例7: display
/**
* create a string for output with all header information
*
* @param OutputDevice $od
*/
public function display(OutputDevice $od)
{
$header = $this->getDoctypeTag() . "\n";
$header .= $this->getHtmlTag() . "\n";
$header .= Html::startTag('head') . "\n";
$header .= "\t" . $this->getEncodingTag() . "\n";
$header .= "\t" . $this->getTitleTag() . "\n";
$header .= "\t" . $this->getDescriptionTag() . "\n";
$header .= "\t" . $this->getCSSLink();
$header .= "\t" . $this->getScripts();
$header .= Html::endTag('head') . "\n";
$od->addContent($header);
}
示例8: _shortenContent
/**
* @param $content
* @return string
*/
private function _shortenContent($content)
{
$contentParts = str_split($content, 400);
$contentShow = $contentParts[0]
. Html::startTag('span', ['class' => 'show'])
. '... '
. Html::url('#', 'mehr', ['class' => 'show'])
. Html::endTag('span');
$contentHide = Html::startTag('span', ['class' => 'hide'])
. $contentParts[1]
. Html::endTag('span');
$content = $contentShow . $contentHide;
return $content;
}
示例9: getWriteDisplay
protected function getWriteDisplay()
{
$fi = $this->fieldinfo;
$class = $fi->getConnectedClass();
$connectedField = $fi->getFieldsOfConnectedClass();
$objs = Finder::create($class)->find();
$output = Html::startTag('select', array('class' => $this->class, 'name' => $this->name));
foreach ($objs as $obj) {
$params = [];
$actualFieldValue = $obj[$connectedField];
if ($this->value == $actualFieldValue) {
$params['selected'] = 'selected';
}
$params['value'] = $obj->getLogicalKey();
$output .= Html::startTag('option', $params) . $actualFieldValue . Html::endTag('option');
}
$output .= Html::endTag('select');
return $output;
}
示例10: getWriteDisplay
/**
* show the data in n input element for editing
*
* @return string
*/
protected function getWriteDisplay()
{
$params['name'] = $this->getName();
if (!empty($this->id)) {
$params['id'] = $this->id;
}
if (!empty($this->class)) {
$params['class'] = $this->class;
}
$params['cols'] = $this->cols;
$params['rows'] = $this->rows;
$textArea = Html::startTag('textarea', $params);
if (!empty($this->value)) {
$textArea .= $this->getValue();
}
$textArea .= Html::endTag('textarea');
return $textArea;
}
示例11: label
public function label($name, $inputName, $attributes = array())
{
$id = "label_$inputName";
$attributes = Html::extendAttributeIfExists('id', $id, $attributes);
$attributes = Html::extendAttributeIfExists('class', 'label', $attributes);
$label = Html::startTag('span', $attributes);
$label .= $name;
$label .= Html::endTag('span');
return $label;
}
示例12: toString
public function toString()
{
$this->attributes['class'] = $this->cssClass;
if (isset($this->cssID)) {
$this->attributes['id'] = $this->cssID;
}
$table = Html::startTag('table', $this->attributes);
if (isset($this->headRow)) {
$table .= Html::startTag('thead') . $this->headRow->toString() . Html::endTag('thead');
}
if (!empty($this->rows)) {
$table .= Html::startTag('tbody');
foreach ($this->rows as $row) {
$table .= $row->toString();
}
$table .= Html::endTag('tbody');
}
$table .= Html::endTag('table');
return $table;
}
示例13: _displayEntry
private function _displayEntry(NavigationEntry $entry)
{
$string = Html::startTag('li', array('class' => 'naviEntry', 'id' => "entryLK_{$entry->getLogicalKey()}"));
$string .= Html::url(HTML_ROOT . $entry['url'], $entry['name']);
$string .= Html::endTag('li');
return $string;
}
示例14: getReadOnlyDisplay
/**
* show the data without input element, because editing is not possible
*
* @return string
*/
protected function getReadOnlyDisplay()
{
return Html::startTag('div', array('class' => $this->class. ' formWidth' . $this->displayedLength)) . $this->value . " %" . Html::endTag('div');
}
示例15: require_once
* User: Alex
* Date: 12.01.2015
* Time: 11:54
*/
require_once (dirname(__DIR__) . '/config.php');
$od = new OutputDevice();
base_ui_Site::displayHead($od);
base_ui_Site::displayTop($od);
base_ui_Site::displayNavigation($od);
base_ui_Site::startMainContent($od);
$rh = new RequestHelper();
$controllerClass = $rh->getParam('controller');
/** @var Controller $controller */
$controller = new $controllerClass();
$od->addContent(Html::startTag('h3'));
$od->addContent($controller->getPageTitle());
$od->addContent(Html::endTag('h3'));
$controller->display($od);
base_ui_Site::endMainContent($od);
base_ui_Site::displayBottom($od);
print $od->toString();