本文整理汇总了PHP中html::li方法的典型用法代码示例。如果您正苦于以下问题:PHP html::li方法的具体用法?PHP html::li怎么用?PHP html::li使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html
的用法示例。
在下文中一共展示了html::li方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: expected_link
private function expected_link($text, $number = null)
{
if ($number === null) {
$number = $text;
}
$var = $number - 1;
$attributes['href'] = "example.com?one=fish&two=fish&page={$var}";
return html::li('', html::a($attributes, $text));
}
示例2: sign_up_sign_in
public static function sign_up_sign_in($url)
{
// TODO: add sign in as guest.
$dropdown_content = array('class' => 'dropdown-menu', 'style' => 'padding: 15px; padding-bottom: 0px;');
$form = array('method' => 'post', 'action' => $url, 'accept-charset' => 'UTF-8');
$username = array('type' => 'text', 'placeholder' => 'Username', 'id' => 'username', 'name' => 'username');
$password = array('type' => 'password', 'placeholder' => 'Password', 'id' => 'password', 'name' => 'password');
$submit = array('value' => 'Sign In', 'class' => 'btn btn-primary btn-block', 'id' => 'sign-in');
return html::ul('nav pull-right', html::li(html::a(new moodle_url('/login/signup.php'), 'Sign Up')) . bootstrap::list_divider() . bootstrap::dropdown('Sign In', html::div($dropdown_content, html::form($form, html::input($username) . html::input($password) . html::checkbox('rememberusername', 'Remember username') . html::submit($submit)))));
}
示例3: test_li_with_attributes_and_empty_string_args
public function test_li_with_attributes_and_empty_string_args()
{
$attributes = array('class' => 'test', 'data' => '0101');
$actual = html::li($attributes, '');
$expected = '<li class=test data=0101></li>';
$this->assertSame($expected, $actual);
}
示例4: render_custom_menu_item
protected function render_custom_menu_item(custom_menu_item $menunode, $submenu = null)
{
if ('list_divider' === $menunode->get_text()) {
return bootstrap::list_divider();
}
if (!$menunode->has_children()) {
return $this->render_custom_menu_leaf($menunode);
}
foreach ($menunode->get_children() as $child) {
$items[] = $this->render_custom_menu_item($child, true);
}
if ($submenu === true) {
return html::li(bootstrap::dropdown_submenu($menunode->get_text(), $items));
} else {
return html::li(bootstrap::dropdown_menu($menunode->get_text(), $items));
}
}
示例5: li_icon_link
public static function li_icon_link($href, $icon, $text)
{
return html::li(self::icon_link($href, $icon, $text));
}
示例6: skipped
private function skipped()
{
return html::li('disabled', html::span('...'));
}
示例7: required_column
/**
* Formats the information that needs to go in the 'Requires' column.
* @param plugininfo_base $plugin the plugin we are rendering the row for.
* @param plugin_manager $pluginman provides data on all the plugins.
* @param string $version
* @return string HTML code
*/
protected function required_column(plugininfo_base $plugin, plugin_manager $pluginman, $version)
{
$requires = array();
if (!empty($plugin->versionrequires)) {
$required = get_string('moodleversion', 'core_plugin', $plugin->versionrequires);
if ($plugin->versionrequires > $version) {
$required = label::important($required);
}
$requires[] = html::li($required);
}
foreach ($plugin->get_other_required_plugins() as $component => $requiredversion) {
$ok = true;
$otherplugin = $pluginman->get_plugin_info($component);
if (is_null($otherplugin)) {
$ok = false;
} else {
if ($requiredversion != ANY_VERSION and $otherplugin->versiondisk < $requiredversion) {
$ok = false;
}
}
if ($requiredversion != ANY_VERSION) {
$required = get_string('otherpluginversion', 'core_plugin', array('component' => $component, 'version' => $requiredversion));
} else {
$required = get_string('otherplugin', 'core_plugin', array('component' => $component, 'version' => $requiredversion));
}
if (!$ok) {
$required = label::important($required);
}
$requires[] = html::li($required);
}
if (!$requires) {
return '';
}
return html::ul('unstyled', $requires);
}
示例8: disabled_navigation_node
protected function disabled_navigation_node(navigation_node $node, $wrap = true)
{
$items = $node->children;
if ($items->count() == 0) {
return '';
}
foreach ($items as $item) {
if (!$item->display) {
continue;
}
$isbranch = $item->children->count() > 0 || $item->nodetype == navigation_node::NODETYPE_BRANCH;
if ($isbranch) {
$item->hideicon = true;
}
$content = $this->output->render($item);
$classes = 'tree_item';
$expanded = 'true';
if (!$item->forceopen || !$item->forceopen && $item->collapse || $item->children->count() == 0 && $item->nodetype == navigation_node::NODETYPE_BRANCH) {
$classes = classes::add_to($classes, 'collapsed');
if ($isbranch) {
$expanded = "false";
$classes = classes::add_to($classes, 'branch');
}
}
if ($item->isactive === true) {
$classes = classes::add_to($classes, 'active');
}
$attributes = array('class' => $classes, 'aria-expanded' => $expanded);
$content .= $this->navigation_node($item);
$lis[] = html::li($attributes, $content);
}
$output = implode($lis);
if ($wrap) {
return html::ul('nav nav-list block_tree', $output);
}
return $output;
}
示例9: navigation_tree
public function navigation_tree(global_navigation $navigation, $expansionlimit, array $options = array())
{
$navigation->add_class('navigation_node');
$content = $this->navigation_node(array($navigation), array('class' => 'block_tree list nav nav-list'), $expansionlimit, $options);
if (!isset($navigation->id) && !is_numeric($navigation->id) && !empty($content)) {
$attributes = array('class' => 'block_tree_box', 'id' => $navigation->id);
$content = html::li($attributes, $content);
}
return $content;
}
示例10: tolist
static function tolist($list, $type, $style = null)
{
$html_list = '';
foreach ($list as $url => $value) {
if (is_array($value)) {
$row = html::tolist($value, $type, $style);
} else {
$row = $value;
}
$html_list .= html::a(html::li($row), "href='{$url}'");
}
switch ($type) {
case 'ol':
$html_list = html::ol($html_list, "type='{$style}'");
break;
case 'ul':
$html_list = html::ul($html_list, "style='list-style-type:{$style}'");
break;
default:
$html_list = html::ul($html_list, "style='list-style-type:none'");
break;
}
return $html_list;
}