本文整理汇总了PHP中HtmlElement::addCssClass方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlElement::addCssClass方法的具体用法?PHP HtmlElement::addCssClass怎么用?PHP HtmlElement::addCssClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlElement
的用法示例。
在下文中一共展示了HtmlElement::addCssClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: front
public function front()
{
global $design_head, $content;
$design_head .= '<script type="text/javascript" src="inc/AJAX/ajax_suggest.js"></script>' . "\n";
$html = new \HtmlElement("div");
$html->addCssClass("kiosk");
// Page title
$html->addElement("div")->addCssClass("page-title")->addElement("h1", "Kiosk");
// Print the input field for adding new wares.
$newProductWrapper = $html->addElement("div")->addCssClass("new-product");
$newProductForm = $newProductWrapper->addElement("form");
$newProductForm->setAttribute("action", "?module=kiosk")->setAttribute("method", "post");
$newProductForm->addElement("input")->setAttribute("type", "text")->setAttribute("name", "product_name")->setAttribute("id", "ware")->setAttribute("placeholder", "Produktnavn...")->setAttribute("tabindex", 1)->setAttribute("autocomplete", "off")->setAttribute("onkeyup", "suggest();");
// Suggest div for autocomplete.
$newProductWrapper->addElement("div")->setAttribute("id", "suggest");
// Productlist
if ($this->_kioskSession->hasProducts()) {
$productListWrapper = $html->addElement("div")->addCssClass("products");
$productListWrapper->addElement("h2", "Handlekurv");
// Table
$productListTable = $productListWrapper->addElement("div")->addCssClass("table");
foreach ($this->_kioskSession->getProducts() as $productArrayItem) {
/** @var Product $product */
$product = $productArrayItem["object"];
$amount = $productArrayItem["amount"];
$row = $productListTable->addElement("div")->addCssClass("row");
$row->addElement("div", $product->getName())->addCssClass("cell");
$row->addElement("div", $amount . " stk")->addCssClass("cell");
$row->addElement("div", $product->getPrice() . " kr")->addCssClass("cell");
$options = $row->addElement("div")->addCssClass("cell");
$options->addElement("a")->setAttribute("href", "?module=kiosk&action=addWare&ware=" . $product->getProductID())->addElement("img")->setAttribute("src", "inc/images/plus-15px.png");
$options->addElement("a")->setAttribute("href", "?module=kiosk&action=removeWare&ware=" . $product->getProductID())->addElement("img")->setAttribute("src", "inc/images/minus-15px.png");
}
}
$html->addElement("a", "Reset")->setAttribute("href", "?module=kiosk&action=endSession");
$content .= $html;
}