本文整理汇总了PHP中HTMLTags_URL::get_get_variables方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLTags_URL::get_get_variables方法的具体用法?PHP HTMLTags_URL::get_get_variables怎么用?PHP HTMLTags_URL::get_get_variables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLTags_URL
的用法示例。
在下文中一共展示了HTMLTags_URL::get_get_variables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(HTMLTags_URL $url, Database_Table $table, $order_by, $direction, $offset, $limit, $limit_str, $rows_html_table_caption, $lpnd_class, $data_table_class, $fields, $actions)
{
parent::__construct();
$table_renderer = $table->get_renderer();
/*
* ----------------------------------------
* Check the inputs.
* ----------------------------------------
*/
/*
* ----------------------------------------
* Create the content.
* ----------------------------------------
*/
$limit_previous_next_div = new HTMLTags_Div();
$limit_previous_next_div->set_attribute_str('class', $lpnd_class);
/*
* To allow the user to set the number of extras to show at a time.
*/
$limit_action = clone $url;
$limit_action->delete_all_get_variables();
$limit_form = new Database_LimitForm($limit_action, $limit, $limit_str);
$get_vars = $url->get_get_variables();
foreach (array_keys($get_vars) as $key) {
$limit_form->add_hidden_input($key, $get_vars[$key]);
}
$limit_form->add_hidden_input('order_by', $order_by);
$limit_form->add_hidden_input('direction', $direction);
$limit_form->add_hidden_input('offset', $offset);
$limit_previous_next_div->append_tag_to_content($limit_form);
$previous_next_url = clone $url;
$previous_next_url->set_get_variable('order_by', $order_by);
$previous_next_url->set_get_variable('direction', $direction);
$row_count = $table->count_all_rows();
$previous_next_ul = new Database_PreviousNextUL($previous_next_url, $offset, $limit, $row_count);
$limit_previous_next_div->append_tag_to_content($previous_next_ul);
$this->append_tag_to_content($limit_previous_next_div);
# ------------------------------------------------------------------
/*
* The table.
*/
$rows_html_table = new HTMLTags_Table();
$rows_html_table->set_attribute_str('class', $data_table_class);
/*
* The caption.
*/
$caption = new HTMLTags_Caption($rows_html_table_caption);
$rows_html_table->append_tag_to_content($caption);
/*
* The Heading Row.
*/
$sort_href = clone $url;
$sort_href->set_get_variable('limit', $limit);
$heading_row = new Database_SortableHeadingTR($sort_href, $direction);
//if (isset($fields_str)) {
// $fields = array();
//
// foreach (explode(' ', $fields_str) as $field_name) {
// $fields[] = $table->get_field($field_name);
// }
//} else {
// $fields = $table->get_fields();
//}
foreach ($fields as $field) {
if ($field['sortable']) {
$heading_row->append_sortable_field_name($field['name']);
} else {
$heading_row->append_nonsortable_field_name($field['name']);
}
}
foreach ($actions as $action) {
$heading_row->append_tag_to_content($action['th']);
}
$rows_html_table->append_tag_to_content($heading_row);
# ------------------------------------------------------------------
/*
* Display the contents of the table.
*/
$rows = $table->get_all_rows($order_by, $direction, $offset, $limit);
foreach ($rows as $row) {
$row_renderer = $row->get_renderer();
$data_tr = new HTMLTags_TR();
foreach ($fields as $field) {
$field_td = self::get_html_table_cell_for_field($field, $row_renderer);
$data_tr->append_tag_to_content($field_td);
}
//foreach (
// $row_renderer->get_action_tds(
// $actions_str,
// $url
// )
// as
// $action_td
//) {
// $data_tr->append_tag_to_content($action_td);
//}
foreach ($actions as $action) {
$action_td = self::get_html_table_cell_for_field($action, $row_renderer);
$data_tr->append_tag_to_content($action_td);
}
//.........这里部分代码省略.........