本文整理汇总了PHP中HTMLTags_URL::set_get_variable方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLTags_URL::set_get_variable方法的具体用法?PHP HTMLTags_URL::set_get_variable怎么用?PHP HTMLTags_URL::set_get_variable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLTags_URL
的用法示例。
在下文中一共展示了HTMLTags_URL::set_get_variable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: make_local_url
/**
* Makes a local URL.
*
* Assumes that you want an OO page.
*/
public static function make_local_url($page_class, $get_variables = NULL)
{
$url = new HTMLTags_URL();
#if (isset($get_variables)) {
# $url->set_file('/');
#
# $url->set_get_variable('oo-page');
# $url->set_get_variable('page-class', $page_class);
#
# foreach ($get_variables as $k => $v) {
# $url->set_get_variable($k, $v);
# }
#} else {
# $url->set_file("/$page_class");
#}
$url->set_file('/');
$url->set_get_variable('oo-page');
$url->set_get_variable('page-class', $page_class);
if (isset($get_variables)) {
foreach ($get_variables as $k => $v) {
$url->set_get_variable($k, $v);
}
}
return $url;
}
示例2: get_url
/**
* DEPRECATED!
*
* Use PublicHTML_URLHelper::get_pm_page_url(...) instead!
*/
public static function get_url($section, $module, $page, $type)
{
$url = new HTMLTags_URL();
$url->set_file('/');
$url->set_get_variable('section', $section);
if (isset($module)) {
$url->set_get_variable('module', $module);
}
$url->set_get_variable('page', $page);
$url->set_get_variable('type', $type);
return $url;
}
示例3: get_admin_page_html_table_tr
public function get_admin_page_html_table_tr()
{
$page_row = $this->get_element();
$admin_pages_html_table_tr = new HTMLTags_TR();
$name_td = new HTMLTags_TD();
$name_td->append_str_to_content($page_row->get_name());
$admin_pages_html_table_tr->append_tag_to_content($name_td);
$author_td = new HTMLTags_TD();
$author_td->append_str_to_content($page_row->get_author());
$admin_pages_html_table_tr->append_tag_to_content($author_td);
$title_td = new HTMLTags_TD();
#$title_td->append_str_to_content($page_row->get_title());
$title_td->append_tag_to_content($this->get_title_a());
$admin_pages_html_table_tr->append_tag_to_content($title_td);
/*
* The actions
*/
$confirmation_url_base = new HTMLTags_URL();
$confirmation_url_base->set_file('/');
$confirmation_url_base->set_get_variable('section', 'haddock');
$confirmation_url_base->set_get_variable('module', 'admin');
$confirmation_url_base->set_get_variable('page', 'admin-includer');
$confirmation_url_base->set_get_variable('type', 'html');
$confirmation_url_base->set_get_variable('admin-section', 'haddock');
$confirmation_url_base->set_get_variable('admin-module', 'database');
/*
* Edit the page's details.
*/
$edit_td = new HTMLTags_TD();
$edit_url = clone $confirmation_url_base;
$edit_url->set_get_variable('admin-page', 'edit-page');
$edit_url->set_get_variable('page_id', $page_row->get_id());
$edit_a = new HTMLTags_A('Edit');
$edit_a->set_href($edit_url);
$edit_td->append_tag_to_content($edit_a);
$admin_pages_html_table_tr->append_tag_to_content($edit_td);
/*
* Delete the page.
*/
$delete_td = new HTMLTags_TD();
$delete_url = clone $confirmation_url_base;
$delete_url->set_get_variable('admin-page', 'delete-page');
$delete_url->set_get_variable('page_id', $page_row->get_id());
$delete_a = new HTMLTags_A('Delete');
$delete_a->set_href($delete_url);
$delete_td->append_tag_to_content($delete_a);
$admin_pages_html_table_tr->append_tag_to_content($delete_td);
return $admin_pages_html_table_tr;
}
示例4: get_current_url
public function get_current_url()
{
$current_url = new HTMLTags_URL();
if ($_SERVER['HTTPS']) {
$current_url->set_scheme('https');
} else {
$current_url->set_scheme('http');
}
if (preg_match('/([-\\w.]+):(\\d+)/', $_SERVER['HTTP_HOST'], $matches)) {
$current_url->set_domain($matches[1]);
$current_url->set_port($matches[2]);
} else {
$current_url->set_domain($_SERVER['HTTP_HOST']);
}
$file = $_SERVER['REQUEST_URI'];
if (preg_match('/(.*)\\?/', $file, $matches)) {
$file = $matches[1];
}
$current_url->set_file($file);
foreach (array_keys($_GET) as $get_var_key) {
$current_url->set_get_variable($get_var_key, $_GET[$get_var_key]);
}
return $current_url;
}
示例5: catch
$page_manager->set_return_to_url($return_to_url);
/*
* Delete any session variables that were set during
* any attempts to fill in the form.
*/
$exception_on_not_set = FALSE;
$svm->delete('create-new-account: email', $exception_on_not_set);
$svm->delete('create-new-account: confirm_email', $exception_on_not_set);
} catch (InputValidation_InvalidInputException $e) {
#print_r($e);
#exit;
/*
* If there's been an input error,
* go back to the form.
*/
$form_location->set_get_variable('error_message', $e->getMessage());
$page_manager->set_return_to_url($form_location);
}
#exit;
}
/*
* If the user wants to wipe the slate.
*/
if (isset($_GET['cancel'])) {
/*
* Delete any session variables that were set during
* any attempts to fill in the form.
*/
$exception_on_not_set = FALSE;
$svm->delete('create-new-account: email', $exception_on_not_set);
$svm->delete('create-new-account: confirm_email', $exception_on_not_set);
示例6:
<?php
/**
* Give the customer a chance to create a new account.
*
* @copyright Clear Line Web Design, 2007-09-21
*/
$existing_customer_log_in_div = new HTMLTags_Div();
$existing_customer_log_in_div->set_attribute_str('id', 'existing_customer_log_in_div');
$existing_customer_log_in_p_text = <<<TXT
If you already have a password, please log in here:
TXT;
$existing_customer_log_in_div->append_tag_to_content(new HTMLTags_P($existing_customer_log_in_p_text));
$existing_customer_log_in_link = new HTMLTags_A('Existing Customer Log In');
$existing_customer_log_in_link->set_attribute_str('class', 'cool_button');
$existing_customer_log_in_link->set_attribute_str('id', 'existing_customer_log_in_button');
$existing_customer_log_in_location = new HTMLTags_URL();
$existing_customer_log_in_location->set_file('/');
$existing_customer_log_in_location->set_get_variable('section', 'plug-ins');
$existing_customer_log_in_location->set_get_variable('module', 'shop');
$existing_customer_log_in_location->set_get_variable('page', 'log-in');
$existing_customer_log_in_location->set_get_variable('type', 'html');
if (isset($_GET['return_to'])) {
$existing_customer_log_in_location->set_get_variable('return_to', $_GET['return_to']);
}
$existing_customer_log_in_link->set_href($existing_customer_log_in_location);
$existing_customer_log_in_div->append_tag_to_content($existing_customer_log_in_link);
echo $existing_customer_log_in_div->get_as_string();
示例7:
<?php
/**
* Give the customer a chance to create a new account.
*
* @copyright Clear Line Web Design, 2007-09-21
*/
$create_new_customer_div = new HTMLTags_Div();
$create_new_customer_div->set_attribute_str('id', 'create_new_customer_div');
$create_new_customer_link = new HTMLTags_A('Create New Account');
$create_new_customer_link->set_attribute_str('class', 'cool_button');
$create_new_customer_link->set_attribute_str('id', 'create_new_customer_button');
$create_new_customer_location = new HTMLTags_URL();
$create_new_customer_location->set_file('/');
$create_new_customer_location->set_get_variable('section', 'plug-ins');
$create_new_customer_location->set_get_variable('module', 'shop');
#$create_new_customer_location->set_get_variable('page', 'customer-details');
$create_new_customer_location->set_get_variable('page', 'create-new-account');
$create_new_customer_location->set_get_variable('type', 'html');
if (isset($_GET['return_to'])) {
$create_new_customer_location->set_get_variable('return_to', $_GET['return_to']);
}
$create_new_customer_link->set_href($create_new_customer_location);
$create_new_customer_div->append_tag_to_content($create_new_customer_link);
echo $create_new_customer_div->get_as_string();
示例8: get_delete_row_a
public function get_delete_row_a()
{
$order = $this->get_element();
$delete_row_link = new HTMLTags_A('Delete');
$delete_row_link->set_attribute_str('class', 'cool_button');
$delete_row_location = new HTMLTags_URL();
$delete_row_location->set_file('/');
$delete_row_location->set_get_variable('page', 'shopping-basket');
$delete_row_location->set_get_variable('type', 'redirect-script');
$delete_row_location->set_get_variable('delete_order_id', $order->get_id());
$delete_row_link->set_href($delete_row_location);
return $delete_row_link;
}
示例9: get_log_out_url
public function get_log_out_url()
{
$log_out_url = new HTMLTags_URL();
$log_out_url->set_file('/');
$log_out_url->set_get_variable('section', 'haddock');
$log_out_url->set_get_variable('module', 'admin');
$log_out_url->set_get_variable('page', 'log-out');
$log_out_url->set_get_variable('type', 'redirect-script');
return $log_out_url;
}
示例10:
<?php
/**
* The p the link to the page for all the products.
*
* @copyright Clear Line Web Design, 2007-07-26
*/
$all_products_link = new HTMLTags_A('See All Products');
$all_products_location = new HTMLTags_URL();
$all_products_location->set_file('/');
$all_products_location->set_get_variable('section', 'plug-ins');
$all_products_location->set_get_variable('module', 'shop');
$all_products_location->set_get_variable('page', 'products');
$all_products_location->set_get_variable('type', 'html');
$all_products_link->set_href($all_products_location);
$all_products_link_p = new HTMLTags_P();
$all_products_link_p->append_tag_to_content($all_products_link);
echo $all_products_link_p->get_as_string();
示例11: get_full_product_div_in_public
public function get_full_product_div_in_public()
{
$full_product_div = new HTMLTags_Div();
$product = $this->get_element();
$design_photograph = $product->get_design_photograph();
$design_photograph_renderer = $design_photograph->get_renderer();
$database = $product->get_database();
$shopping_baskets_table = $database->get_table('hpi_shop_shopping_baskets');
$hlisting_div = new HTMLTags_Div();
$hlisting_div->set_attribute_str('id', 'single-product');
$hlisting_div->set_attribute_str('class', 'hlisting offer-sale full-item');
$hlisting_summary_div = new HTMLTags_Div();
$hlisting_summary_div->set_attribute_str('class', 'summary');
$hlisting_summary_div->append_str_to_content($product->get_name());
$hlisting_div->append_tag_to_content($hlisting_summary_div);
$hlisting_description_div = new HTMLTags_Div();
$hlisting_description_div->set_attribute_str('class', 'description');
$hlisting_images_div = new HTMLTags_Div();
$hlisting_images_div->set_attribute_str('class', 'images');
if (isset($_GET['thumbnail_photograph_id'])) {
$photographs_table = $database->get_table('hpi_shop_photographs');
$main_photograph = $photographs_table->get_row_by_id($_GET['thumbnail_photograph_id']);
} else {
$main_photograph = $product->get_main_photograph();
}
$main_photograph_renderer = $main_photograph->get_renderer();
$main_img = $main_photograph_renderer->get_full_size_img();
$hlisting_images_div->append_tag_to_content($main_img);
$thumbnail_div = $this->get_extras_thumbnail_div($main_photograph);
$hlisting_images_div->append_tag_to_content($thumbnail_div);
$design_img = $design_photograph_renderer->get_full_size_img();
$hlisting_images_div->append_tag_to_content($design_img);
$hlisting_description_div->append_tag_to_content($hlisting_images_div);
// $hlisting_description_p = new HTMLTags_P($product->get_description());
// $hlisting_description_div->append_tag_to_content($hlisting_description_p);
$hlisting_description_div->append_str_to_content($product->get_description());
$hlisting_div->append_tag_to_content($hlisting_description_div);
$product_details_ul = $this->get_product_details_ul();
$product_details_div = new HTMLTags_Div();
$product_details_div->set_attribute_str('class', 'details');
$product_details_div->append_tag_to_content($product_details_ul);
// CHECK TO SEE IF PRODUCT IS IN SHOPPING BASKET
$shopping_basket_already_exists = $shopping_baskets_table->check_for_product_in_current_session($product->get_id(), session_id());
if ($shopping_basket_already_exists) {
$conditions['product_id'] = $product->get_id();
$conditions['session_id'] = "'" . session_id() . "'";
$conditions['deleted'] = 'no';
$conditions['moved_to_orders'] = 'no';
$shopping_basket_row = $shopping_baskets_table->get_rows_where($conditions);
//print_r($shopping_basket_row);
$previous_quantity = $shopping_basket_row[0]->get_quantity();
$previous_purchase_p = new HTMLTags_P();
$previous_purchase_p->set_attribute_str('class', 'previous-purchase');
$previous_purchase_text = <<<TXT
You already have
TXT;
$previous_purchase_text .= $shopping_basket_row[0]->get_quantity();
$previous_purchase_text .= <<<TXT
of these in your Shopping Basket.
TXT;
$previous_purchase_p->append_str_to_content($previous_purchase_text);
$product_details_div->append_tag_to_content($previous_purchase_p);
} else {
}
if ($product->is_active() && !$product->is_out_of_stock()) {
//Link to ADD TO BASKET
$add_to_basket_link = $this->get_add_to_shopping_basket_link();
$add_to_basket_link_p = new HTMLTags_P();
$add_to_basket_link_p->set_attribute_str('class', 'options');
$add_to_basket_link_p->append_tag_to_content($add_to_basket_link);
$product_details_div->append_tag_to_content($add_to_basket_link_p);
} else {
if ($product->is_out_of_stock()) {
$other_products_link = new HTMLTags_A();
$other_products_link->append_str_to_content('See other products');
$other_products_location = new HTMLTags_URL();
$other_products_location->set_file('/');
$other_products_location->set_get_variable('section', 'plug-ins');
$other_products_location->set_get_variable('module', 'shop');
$other_products_location->set_get_variable('page', 'products');
$other_products_location->set_get_variable('type', 'html');
$other_products_link->set_href($other_products_location);
$other_products_available_p = new HTMLTags_P();
$other_products_available_p->append_tag_to_content($other_products_link);
$product_details_div->append_tag_to_content($other_products_available_p);
} else {
$customer_regions_table = $database->get_table('hpi_shop_customer_regions');
$customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']);
$product_not_available_p = new HTMLTags_P();
$product_not_available_p->append_str_to_content('This product is not available in ');
$product_not_available_p->append_str_to_content($customer_region->get_name_with_the());
$product_not_available_p->append_str_to_content('.');
$product_details_div->append_tag_to_content($product_not_available_p);
$product_category = $product->get_product_category();
if ($product_category->is_active()) {
$other_products_in_category_link = new HTMLTags_A();
$other_products_in_category_link->append_str_to_content('See other ' . $product_category->get_name() . ' available in ' . $customer_region->get_name_with_the());
$other_products_in_category_location = new HTMLTags_URL();
$other_products_in_category_location->set_file('/');
$other_products_in_category_location->set_get_variable('section', 'plug-ins');
//.........这里部分代码省略.........
示例12: get_changed_confirmation_div
public function get_changed_confirmation_div()
{
$customer_region = $this->get_element();
$confirmation_div = new HTMLTags_Div();
$confirmation_text = <<<TXT
You have changed your region to
TXT;
$confirmation_text .= $customer_region->get_name_with_the();
$confirmation_text .= <<<TXT
.
TXT;
$confirmation_text_p = new HTMLTags_P($confirmation_text);
$confirmation_div->append_tag_to_content($confirmation_text_p);
$all_products_link = new HTMLTags_A('View Products Available in ' . $customer_region->get_name_with_the());
// $all_products_link->set_attribute_str('class', 'all_products');
$all_products_location = new HTMLTags_URL();
$all_products_location->set_file('/');
$all_products_location->set_get_variable('section', 'plug-ins');
$all_products_location->set_get_variable('module', 'shop');
$all_products_location->set_get_variable('page', 'products');
$all_products_location->set_get_variable('type', 'html');
$all_products_location->set_get_variable('customer_region_session', $customer_region->get_id());
$all_products_link->set_href($all_products_location);
$confirmation_div->append_tag_to_content($all_products_link);
return $confirmation_div;
}
示例13:
$enter_r_pw_a->set_href($enter_r_pw_url);
$enter_r_pw_p->append_tag_to_content($enter_r_pw_a);
$enter_r_pw_p->append_str_to_content(' to try again.');
$content_div->append_tag_to_content($enter_r_pw_p);
} else {
/*
* A link to sign out.
*/
#print_r($_SESSION);
$root_pw_status_p = new HTMLTags_P();
$root_pw_status_p->append_str_to_content('The root password has been entered.');
$content_div->append_tag_to_content($root_pw_status_p);
$sign_out_p = new HTMLTags_P();
$sign_out_p->append_str_to_content('Click ');
$sign_out_a = new HTMLTags_A('here');
$sign_out_url = new HTMLTags_URL();
$sign_out_url->set_file('/admin/redirect-script.php');
$sign_out_url->set_get_variable('module', 'database');
$sign_out_url->set_get_variable('page', 'sign-in-as-root');
$sign_out_url->set_get_variable('sign_out');
$sign_out_a->set_href($sign_out_url);
$sign_out_p->append_tag_to_content($sign_out_a);
$sign_out_p->append_str_to_content(' to sign out.');
$content_div->append_tag_to_content($sign_out_p);
}
}
}
/*
* -----------------------------------------------------------------------------
*/
echo $content_div;
示例14: urlencode
<?php
/**
* The default form for adding an email address to the mailing list.
*
* @copyright Clear Line Web Design, 2007-07-20
*/
//<form
$form_email_adding = new HTMLTags_Form();
/*
* Form altered by RFI 2007-07-13
*/
$form_action = new HTMLTags_URL();
$form_action->set_file('/');
$form_action->set_get_variable('section', 'plug-ins');
$form_action->set_get_variable('module', 'mailing-list');
$form_action->set_get_variable('page', 'mailing-list');
$form_action->set_get_variable('type', 'redirect-script');
$form_action->set_get_variable('add_person');
$form_action->set_get_variable('return_to', urlencode('/?section=project-specific&page=mailing-list'));
#echo 'action="' . $form_action->get_as_string() . "\"\n";
$form_email_adding->set_action($form_action);
$form_email_adding->set_attribute_str('method', 'POST');
// method="POST"
//>
$ul_inputs = new HTMLTags_UL();
$li_name = new HTMLTags_LI();
// <label for="name">Name:</label>
$label_name = new HTMLTags_Label('Name: ');
$label_name->set_attribute_str('for', 'name');
$li_name->append_tag_to_content($label_name);
示例15: get_url_for_page_in_module_in_section
public function get_url_for_page_in_module_in_section($page, $module, $section)
{
$page_element = $this->get_page_element_in_module_in_section($page, $module, $section);
if ($page_element->hasAttribute('url')) {
$url = new HTMLTags_URL($page_element->getAttribute('url'));
} else {
$url = new HTMLTags_URL();
$url->set_file('/');
$url->set_get_variable('section', 'haddock');
$url->set_get_variable('module', 'admin');
$url->set_get_variable('page', 'admin-includer');
$url->set_get_variable('type', 'html');
if ($page_element->hasAttribute('special_page') && $page_element->getAttribute('special_page') == 'db-table-xml') {
$url->set_get_variable('admin-section', 'haddock');
$url->set_get_variable('admin-module', 'database');
$url->set_get_variable('admin-page', 'table-xml');
$url->set_get_variable('db-section', $section);
$url->set_get_variable('db-module', $module);
$url->set_get_variable('db-xml-file', $page);
} else {
$url->set_get_variable('admin-section', $section);
$url->set_get_variable('admin-module', $module);
$url->set_get_variable('admin-page', $page);
}
}
return $url;
}