本文整理汇总了PHP中HtmlHelper::generateId方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlHelper::generateId方法的具体用法?PHP HtmlHelper::generateId怎么用?PHP HtmlHelper::generateId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlHelper
的用法示例。
在下文中一共展示了HtmlHelper::generateId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pagination
function pagination()
{
$this->helper->filter->defaults($this->args, array('items_per_page' => 10, 'item_count' => 0, 'visible_pages' => 10, 'link_url' => UrlHelper::currentPath(true, array('page' => '###')), 'url_page_marker' => '###', 'current_page' => 1, 'show_single_page' => false, 'show_arrows' => false, 'show_pages' => true, 'css_class' => 'pagination', 'left_arrow' => '<', 'right_arrow' => '>', 'more_pages' => '...', 'id' => HtmlHelper::generateId()));
$max_page = ceil($this->args['item_count'] / $this->args['items_per_page']);
if ($this->args['current_page'] > $max_page || $this->args['current_page'] <= 0) {
$this->args['current_page'] = 1;
}
$starting_page = floor(($this->args['current_page'] - 1) / $this->args['visible_pages']) * $this->args['visible_pages'] + 1;
$final_page = min($max_page, $starting_page + $this->args['visible_pages'] - 1);
$this->view->set('starting_page', $starting_page);
$this->view->set('max_page', $max_page);
$this->view->set('final_page', $final_page);
$this->view->setArray($this->args);
}
示例2: __construct
function __construct($tag_name, $id = null, $can_have_children = true)
{
$this->_tag_name = $tag_name;
$this->_attributes["id"] = !is_null($id) ? $id : HtmlHelper::generateId();
$this->_can_have_children = $can_have_children;
}