本文整理汇总了PHP中HtmlElement::AddAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlElement::AddAttributes方法的具体用法?PHP HtmlElement::AddAttributes怎么用?PHP HtmlElement::AddAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlElement
的用法示例。
在下文中一共展示了HtmlElement::AddAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* A widget for displaying an image (img)
* @param string $imgurl The url of the image
* @param string $alttext A text that will be shown if the image could not be loaded
* @param boolean $forcehttps Specify if the link has to have https
* @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
**/
public function __construct($imgurl = EMPTYSTRING, $alttext = '[IMG]', $args = null)
{
parent::__construct();
$img = new HtmlElement('img', $args);
$img->AddAttributes(array('src' => RTK::GetBaseURL() . $imgurl, 'alt' => $alttext));
$this->AddChild($img);
}
示例2: __construct
/**
* A widget for displaying a list of items
* @param string[] $columnheaders The headers in the top row
* @param boolean $alternaterow Determines if different styling should be applied to every other row
* @param boolean $alternatecell Determines if different styling should be applied to every other cell
* @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
**/
public function __construct($columnheaders, $alternaterow = true, $alternatecell = false, $args = null)
{
parent::__construct();
$table = new HtmlElement('div', array('class' => 'listview'), null, new HtmlElement('table'));
$table->AddAttributes($args);
$this->AddContainer($table, 'table');
//$this->SetPointer('table');
if ($alternaterow == false) {
$this->_alternaterow = null;
} else {
$this->_alternaterow = true;
}
if ($alternatecell == false) {
$this->_alternatecell = null;
} else {
$this->_alternatecell = true;
}
if (sizeof($columnheaders) > 0) {
for ($i = 0; $i < sizeof($columnheaders); $i++) {
$string = $columnheaders[$i];
if (is_string($string) && strlen($string) > 0 && $string[0] == '_') {
$this->_compressedcols[] = $i;
$columnheaders[$i] = substr($columnheaders[$i], 1);
}
}
$this->AddHeader($columnheaders);
}
}
示例3: AddJavascript
/**
* Adds a javascript to the HTML document
* @param string $filename The name of the file to add
* @param HtmlAttributes $args Allows custom html tag arguments to be specified (not recommended)
*/
public function AddJavascript($filename, $args = null)
{
$script = new HtmlElement('script', array('src' => $filename));
$script->AddAttributes($args);
$this->_javascripts[$filename] = $script;
}