本文整理汇总了PHP中HTMLTags_URL::get_as_string方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLTags_URL::get_as_string方法的具体用法?PHP HTMLTags_URL::get_as_string怎么用?PHP HTMLTags_URL::get_as_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLTags_URL
的用法示例。
在下文中一共展示了HTMLTags_URL::get_as_string方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect_to_url
public static function redirect_to_url(HTMLTags_URL $url)
{
#throw new Exception('Testing exception handling');
#print_r($url);
$url_as_string = $url->get_as_string();
#echo "\$url_as_string: $url_as_string\n";
#
#exit;
#/*
# * See http://uk.php.net/manual/en/function.header.php#73583
# */
#header('Pragma: private');
#header('Cache-control: private, must-revalidate');
$header_directive = 'Location: ' . $url_as_string;
#echo "\$header_directive: $header_directive\n";
#exit;
header($header_directive);
exit;
}
示例2: get_as_string
public function get_as_string()
{
$pretty_urls = 1;
//$pretty_urls = 0;
if ($pretty_urls) {
$get_variables = $this->get_get_variables();
//print_r($get_variables);exit;
$video_page = VideoLibrary_URLHelper::get_video_page_class_name();
$tags_page = 'VideoLibrary_TagsPage';
switch ($get_variables['page-class']) {
case $video_page:
$url = '/videos/';
$url .= $get_variables['video_id'];
if (isset($get_variables['external_video_provider_id'])) {
$url .= '/channels/' . $get_variables['external_video_provider_id'];
}
break;
case $tags_page:
$url = '/tags/';
if (isset($get_variables['external_video_library_id'])) {
$url .= 'libraries/' . $get_variables['external_video_library_id'];
}
break;
default:
return parent::get_as_string();
}
if (isset($get_variables['start'])) {
$url .= '/' . $get_variables['start'];
}
if (isset($get_variables['duration'])) {
$url .= '/' . $get_variables['duration'];
}
return $url;
} else {
return parent::get_as_string();
}
}
示例3: render_cu_form
/**
* The skeleton of the add and edit ('create' - c and 'update' - u)
* forms.
*/
protected function render_cu_form($name, HTMLTags_URL $action_rsu, HTMLTags_URL $clear_rsu, $title, $ol, $submit_text, $render_opening_tag_method_name)
{
/*
* Use a little reflection magic to be able to alter the method
* called to render the opening tag of the form.
*/
$cn = get_class($this);
$rc = new ReflectionClass($cn);
$crm = $rc->getMethod($render_opening_tag_method_name);
$crm->invoke($this, $name, $action_rsu);
?>
<fieldset>
<legend><?php
echo $title;
?>
</legend>
<?php
echo $ol;
?>
</fieldset>
<div class="submit_buttons_div">
<input
type="submit"
value="<?php
echo $submit_text;
?>
"
class="submit"
/>
<input
type="button"
value="Cancel"
onclick="document.location.href=('<?php
echo $clear_rsu->get_as_string();
?>
')"
class="submit"
/>
</div>
</form>
<?php
}
示例4: get_as_string
public function get_as_string()
{
$pretty_urls = 1;
//$pretty_urls = 0;
if ($pretty_urls) {
$get_variables = $this->get_get_variables();
//print_r($get_variables);exit;
$video_page = VideoLibrary_URLHelper::get_video_page_class_name();
$search_page = VideoLibrary_URLHelper::get_search_page_class_name();
$tags_page = 'VideoLibrary_TagsPage';
$append_url = NULL;
switch ($get_variables['page-class']) {
case $video_page:
$url = '/videos/';
$url .= $get_variables['video_id'];
if (isset($get_variables['external_video_provider_id'])) {
$url .= '/channels/' . $get_variables['external_video_provider_id'];
}
break;
case $tags_page:
$url = '/tags/';
if (isset($get_variables['external_video_library_id'])) {
$url .= 'libraries/' . $get_variables['external_video_library_id'];
}
break;
case $search_page:
$url = '/search';
if (isset($get_variables['external_video_library_id'])) {
$url .= '/libraries/' . $get_variables['external_video_library_id'];
}
if (isset($get_variables['external_video_provider_id'])) {
$url .= '/channels/' . $get_variables['external_video_provider_id'];
}
if (isset($get_variables['tag_ids'])) {
$url .= '/tags/' . $get_variables['tag_ids'];
}
if (isset($get_variables['q'])) {
$append_url .= '?q=' . $get_variables['q'];
}
break;
default:
return parent::get_as_string();
}
if (isset($get_variables['start'])) {
$url .= '/' . $get_variables['start'];
}
if (isset($get_variables['duration'])) {
$url .= '/' . $get_variables['duration'];
}
/*
* If its the video page, stick the name on the end
*/
if ($get_variables['page-class'] == $video_page && isset($get_variables['video_name'])) {
$url .= '/' . $get_variables['video_name'];
}
if (isset($append_url)) {
$url = $url . '/' . $append_url;
}
return $url;
} else {
return parent::get_as_string();
}
}
示例5: get_password_reset_form
public function get_password_reset_form(HTMLTags_URL $form_location, HTMLTags_URL $redirect_script_location, HTMLTags_URL $desired_location, HTMLTags_URL $cancel_page_location)
{
$password_reset_form = new HTMLTags_SimpleOLForm('create_new_account');
$password_reset_form->set_attribute_str('id', $this->get_password_reset_form_id());
$password_reset_form->set_attribute_str('class', $this->get_password_reset_form_css_class());
$svm = Caching_SessionVarManager::get_instance();
/*
* The action.
*/
$password_reset_script_location = clone $redirect_script_location;
$password_reset_script_location->set_get_variable('password_reset');
$password_reset_script_location->set_get_variable('desired_location', urlencode($desired_location->get_as_string()));
$password_reset_script_location->set_get_variable('form_location', urlencode($form_location->get_as_string()));
$password_reset_form->set_action($password_reset_script_location);
$password_reset_form->set_legend_text('Reset Password');
/*
* The input tags.
*/
if ($svm->is_set('password-reset: email')) {
$password_reset_form->add_input_name_with_value('email', $svm->get('password-reset: email'));
} else {
if ($this->is_logged_in()) {
$password_reset_form->add_input_name_with_value('email', $this->get_name());
} else {
$password_reset_form->add_input_name('email');
}
}
/*
* The submit button.
*/
$password_reset_form->set_submit_text('Reset');
/*
* The cancel button
*/
$cancel_location = clone $redirect_script_location;
$cancel_location->set_get_variable('cancel');
$cancel_location->set_get_variable('cancel_page_location', urlencode($cancel_page_location->get_as_string()));
$password_reset_form->set_cancel_location($cancel_location);
return $password_reset_form;
}
示例6: set_href
public function set_href(HTMLTags_URL $href)
{
#print_r($href);
$this->set_attribute_str('href', $href->get_as_string());
}
示例7: get_customer_details_display_div
public function get_customer_details_display_div(HTMLTags_URL $redirect_script_location, HTMLTags_URL $desired_location)
{
$customer_details_div = new HTMLTags_Div();
$customer_details_div->set_attribute_str('id', 'shipping-details-confirmation');
$customer_details_div->append_tag_to_content(new HTMLTags_Heading(3, 'Shipping Details'));
$customer_details_div->append_tag_to_content($this->get_customer_hcard());
$edit_details_link = new HTMLTags_A('Edit Shipping Details');
$edit_details_action = clone $redirect_script_location;
$edit_details_action->set_get_variable('edit_customer_details', 1);
$edit_details_action->set_get_variable('desired_location', urlencode($desired_location->get_as_string()));
$edit_details_link->set_href($edit_details_action);
$edit_details_link->set_attribute_str('class', 'edit-shipping-details');
$customer_details_div->append_tag_to_content($edit_details_link);
return $customer_details_div;
}
示例8: render_body_div_content
//.........这里部分代码省略.........
$li = new HTMLTags_LI();
$pr = $photograph->get_renderer();
$this_photograph_url = clone $url;
$this_photograph_url->set_get_variable('photograph_id', $photograph->get_id());
$tnia = $pr->get_thumbnail_image_a();
$tnia->set_href($this_photograph_url);
$li->append_tag_to_content($tnia);
$photograhps_ul->add_li($li);
}
$content_div->append_tag_to_content($photograhps_ul);
} else {
/**
* LAST ACTION BOX DIV
*
*/
if (isset($_GET['last_deleted_id']) || isset($_GET['last_edited_id']) || isset($_GET['last_added_id']) || isset($_GET['deleted_all'])) {
if (isset($_GET['last_deleted_id'])) {
$message = 'Deleted product id: ' . $_GET['last_deleted_id'];
} elseif (isset($_GET['last_edited_id'])) {
$product = $products_table->get_row_by_id($_GET['last_edited_id']);
$message = 'Edited ' . $product->get_name();
} elseif (isset($_GET['last_added_id'])) {
$product = $products_table->get_row_by_id($_GET['last_added_id']);
$message = 'Added ' . $product->get_name();
} elseif (isset($_GET['deleted_all'])) {
if ($_GET['deleted_all'] == 'successful') {
$message = 'Succesfully deleted
all of your products!
(Not really - feature disabled)';
} else {
$message = 'Failed to delete all of your products.';
}
}
$last_error_box_div = new HTMLTags_LastActionBoxDiv($message, $current_page_url->get_as_string(), 'message');
$content_div->append_tag_to_content($last_error_box_div);
}
/**
* Links to other pages in the admin section.
*/
// $page_options_div = new HTMLTags_Div();
// $page_options_div->set_attribute_str('id', 'page-options');
// $other_pages_ul = new HTMLTags_UL();
/**
* Link to the add row form.
*/
#$add_row_li = new HTMLTags_LI();
#
#$add_row_a = new HTMLTags_A('Add New Product');
#
#$add_row_href = clone $current_page_url;
#$add_row_href->set_get_variable('add_row');
#
#$add_row_a->set_href($add_row_href);
#
#$add_row_li->append_tag_to_content($add_row_a);
#
#$other_pages_ul->append_tag_to_content($add_row_li);
/**
* Link to the delete all confirmation page.
*/
// $delete_all_li = new HTMLTags_LI();
// $delete_all_a = new HTMLTags_A('Delete All Products');
// $delete_all_href = clone $current_page_url;
// $delete_all_href->set_get_variable('delete_all');
// $delete_all_a->set_href($delete_all_href);
// $delete_all_li->append_tag_to_content($delete_all_a);
示例9: set_src
public function set_src(HTMLTags_URL $href)
{
$this->set_attribute_str('src', $href->get_as_string());
}
示例10: get_customer_details_adding_form
public function get_customer_details_adding_form(HTMLTags_URL $form_location, HTMLTags_URL $redirect_script_location, HTMLTags_URL $desired_location, HTMLTags_URL $cancel_page_location)
{
$customers_table = $this->get_element();
$database = $customers_table->get_database();
$telephone_numbers_table = $database->get_table('hpi_shop_telephone_numbers');
$addresses_table = $database->get_table('hpi_shop_addresses');
$customer_details_form = new HTMLTags_SimpleOLForm('customer_details');
$customer_details_form->set_attribute_str('id', $this->get_customer_details_form_id());
$customer_details_form->set_attribute_str('class', $this->get_customer_details_form_css_class());
$svm = Caching_SessionVarManager::get_instance();
/*
* The action.
*/
$customer_details_script_location = clone $redirect_script_location;
$customer_details_script_location->set_get_variable('customer_details');
$customer_details_script_location->set_get_variable('desired_location', urlencode($desired_location->get_as_string()));
$customer_details_script_location->set_get_variable('form_location', urlencode($form_location->get_as_string()));
$customer_details_form->set_action($customer_details_script_location);
$customer_details_form->set_legend_text($this->get_customer_details_form_legend_text());
/*
* The input tags.
*/
/*
* The first_name
*/
$first_name_field = $customers_table->get_field('first_name');
$first_name_field_renderer = $first_name_field->get_renderer();
$input_tag = $first_name_field_renderer->get_form_input();
$input_tag->set_attribute_str('id', 'first_name');
$customer_details_form->add_input_tag('first_name', $input_tag);
/*
* The last_name
*/
$last_name_field = $customers_table->get_field('last_name');
$last_name_field_renderer = $last_name_field->get_renderer();
$input_tag = $last_name_field_renderer->get_form_input();
$input_tag->set_attribute_str('id', 'last_name');
$customer_details_form->add_input_tag('last_name', $input_tag);
/*
* The telephone_number
*/
$telephone_number_field = $telephone_numbers_table->get_field('telephone_number');
$telephone_number_field_renderer = $telephone_number_field->get_renderer();
$input_tag = $telephone_number_field_renderer->get_form_input();
$input_tag->set_attribute_str('id', 'telephone_number');
$customer_details_form->add_input_tag('telephone_number', $input_tag);
/*
* The address (to be put striaght into street_address)
*/
$address_li = $this->get_address_form_input_li();
$customer_details_form->add_input_li($address_li);
/*
* The address_postal_code
*/
$address_field = $addresses_table->get_field('postal_code');
$address_field_renderer = $address_field->get_renderer();
$input_tag = $address_field_renderer->get_form_input();
$input_tag->set_attribute_str('id', 'postal_code');
$customer_details_form->add_input_tag('postal_code', $input_tag);
/*
* The address_country_name
*/
$address_field = $addresses_table->get_field('country_name');
$address_field_renderer = $address_field->get_renderer();
$input_tag = $address_field_renderer->get_form_input();
$input_tag->set_attribute_str('id', 'country_name');
if (isset($_SESSION['customer_region_id'])) {
$customer_regions_table = $database->get_table('hpi_shop_customer_regions');
$customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']);
$input_tag->set_value($customer_region->get_name());
}
$customer_details_form->add_input_tag('country_name', $input_tag);
/*
* The customer_region_id
*/
$customer_region_li = $this->get_customer_region_form_select_li();
$customer_details_form->add_input_li($customer_region_li);
/*
* The submit button.
*/
$customer_details_form->set_submit_text('Add');
/*
* The cancel button
*/
$cancel_location = clone $redirect_script_location;
$cancel_location->set_get_variable('cancel');
$cancel_location->set_get_variable('cancel_page_location', urlencode($cancel_page_location->get_as_string()));
$customer_details_form->set_cancel_location($cancel_location);
return $customer_details_form;
}
示例11: redirect_to_absolute_location
/**
* Takes the local part of a URL
* and turns it into an absolute URL (by looking at the current HTTP env)
* and redirects the browser to the URL.
*/
public static function redirect_to_absolute_location($local_part)
{
$url = new HTMLTags_URL($local_part);
header('Location: ' . $url->get_as_string());
exit;
}
示例12: content
public function content()
{
#print_r($_SESSION);
?>
<h2>Log In to <em>Oedipus: Decision Maker</em></h2>
<?php
DBPages_PageRenderer::render_page_section('log-in', 'general-explanation');
$log_in_redirect_script_url = Oedipus_LogInHelper::get_log_in_redirect_script_url();
?>
<form
id="basic-form"
name="frmRegistration"
method="post"
action="<?php
echo $log_in_redirect_script_url->get_as_string();
?>
"
>
<fieldset>
<legend class="txtFormLegend">Your Details</legend>
<ol>
<li>
<!-- Email address -->
<label for="email">Your Email:</label>
<input
id="email"
name="email"
type="text"
value="<?php
echo $_SESSION['values']['email'];
?>
"
/>
<span
id="email_failed"
class="<?php
echo $_SESSION['errors']['email']['class'];
?>
"
><?php
echo $_SESSION['errors']['email']['message'];
?>
</span>
</li>
<li>
<!-- Password -->
<label for="password">Password:</label>
<input
id="password"
name="password"
type="password"
value=""
/>
<span
id="login_failed"
class="<?php
echo $_SESSION['errors']['login']['class'];
?>
"
><?php
echo $_SESSION['errors']['login']['message'];
?>
</span>
</li>
</ol>
</fieldset>
<div class="submit_buttons_div">
<input
type="submit"
name="submitbutton"
value="Log in"
class="left button"
/>
</div>
</form>
<?php
/*
* Link to reset the password.
*/
$prp_url = new HTMLTags_URL();
$prp_url->set_file('/haddock/public-html/public-html/index.php');
$prp_url->set_get_variable('oo-page');
$prp_url->set_get_variable('page-class', 'Oedipus_PasswordResetPage');
if (isset($_SESSION['values']['email'])) {
$prp_url->set_get_variable('email', urlencode($_SESSION['values']['email']));
}
?>
<ul>
<li>
<a href="<?php
echo $prp_url->get_as_string();
?>
">Forgotten your password?</a>
</li>
</ul>
<?php
}