本文整理汇总了PHP中ClassTools::getDomainLink方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassTools::getDomainLink方法的具体用法?PHP ClassTools::getDomainLink怎么用?PHP ClassTools::getDomainLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassTools
的用法示例。
在下文中一共展示了ClassTools::getDomainLink方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateSearchForm
protected function generateSearchForm()
{
if (!$this->checkSearchDefinition()) {
return '';
}
$controller = $this->search_definition['controller'];
$form = $this->search_definition['form'];
$search_session = $this->getValuesSessionPost($controller);
// print_r($_SESSION);
// print_r($_POST);
// var_dump($search_session);
$o = '<tr class="form_search">';
$o .= '<form method="post" action="' . ClassTools::getDomainLink() . ClassTools::getValue('controller') . '">';
foreach ($form as $column_name => $values) {
$class = isset($values['class']) ? ' class="' . $values['class'] . '"' : '';
$type = isset($values['type']) ? $values['type'] : false;
$o .= "<td{$class}>";
switch ($type) {
case 'text':
$o .= '<input type="text" value="' . ($search_session && isset($search_session[$column_name]) ? htmlspecialchars($search_session[$column_name]) : '') . '" name="' . $column_name . '" />';
break;
case 'select':
$class_select = isset($values['search']) && $values['search'] === true ? 'jsselect' : 'jsselectnosearch';
if (isset($values['optgroup']) && is_array($values['optgroup']) && count($values['optgroup']) > 0) {
$o .= '<select name="' . $column_name . '" class="' . $class_select . '">';
$o .= '<option value="">---</option>';
foreach ($values['optgroup'] as $group) {
$o .= '<optgroup label="' . htmlspecialchars($group['name']) . '">';
if (isset($group['childs']) && is_array($group['childs']) && count($group['childs']) > 0) {
foreach ($group['childs'] as $key_type => $type) {
$selected = $search_session && isset($search_session[$column_name]) && $search_session[$column_name] != '' && $search_session[$column_name] == $key_type ? ' selected="selected"' : '';
$o .= '<option value="' . $key_type . '"' . $selected . '>' . htmlspecialchars($type) . '</option>';
}
}
$o .= '</optgroup>';
}
$o .= '</select>';
} elseif (isset($values['options']) && is_array($values['options']) && count($values['options']) > 0) {
$o .= '<select name="' . $column_name . '" class="' . $class_select . '">';
$o .= '<option value="">---</option>';
foreach ($values['options'] as $option_key => $option_value) {
$selected = $search_session && isset($search_session[$column_name]) && $search_session[$column_name] != '' && $search_session[$column_name] == $option_key ? ' selected="selected"' : '';
$o .= '<option value="' . $option_key . '"' . $selected . '>' . $option_value . '</option>';
}
$o .= '</select>';
}
break;
default:
if ($column_name == 'actions') {
$o .= '<div class="btn-group btn-group-sm">
<button class="btn btn-primary" value="search" name="form_action_search" type="submit">Szukaj</button>
<button class="btn btn-warning" value="search_delete" name="form_action_search" type="submit">Wyczyść</button>
</div>
';
} else {
// $o .= '---';
$o .= '';
}
break;
}
$o .= '</td>';
}
$o .= '</form>';
$o .= '</tr>';
return $o;
}
示例2: sendMailNewPasswordLink
protected function sendMailNewPasswordLink($adres, $password_key)
{
// mail
// $adres = "mariusz@nephax.com";
// od kogo
$from = "System Ewidencji Wojskowej <system@sew.org.pl>";
// temat
$temat = "Resetowanie hasła";
// link
$link = ClassTools::getDomainLink() . "haslo/{$password_key}";
// wysylka
$boundary = "-->===_54654747_===<---->>4255==_";
$head = 'From: ' . $from . "\n";
$head .= "MIME-version: 1.0\n";
$head .= "Content-type: multipart/mixed; ";
$head .= "boundary=\"{$boundary}\"\n";
$head .= "Content-Transfer-Encoding: 8bit\n";
$head .= "charset=\"iso-8859-2\"\n";
$tresc_maila = "--" . $boundary . "\n";
$tresc_maila .= "Content-Type: text/plain; charset=\"iso-8859-2\"\n\n";
$tresc_maila .= "Aby zresetować hasło proszę wejść na na poniższy link:\n\n";
$tresc_maila .= '<a href="' . $link . '">' . $link . '</a>' . "\n\n";
$tresc_maila .= "Link aktywny jest tylko przez " . ClassAuth::$password_link_time . " godzin.\n\n";
$tresc_maila .= "Wiadomość została wygenerowana przez system, prosimy na niego nie odpowiadać.\n\n";
$tresc_maila .= "--" . $boundary . "-- \n\n";
$temat_iso = iconv('UTF-8', 'ISO-8859-2//TRANSLIT', $temat);
$tresc_maila_iso = iconv('UTF-8', 'ISO-8859-2//TRANSLIT', $tresc_maila);
$head_iso = iconv('UTF-8', 'ISO-8859-2//TRANSLIT', $head);
mail($adres, $temat_iso, $tresc_maila_iso, $head_iso);
// mail($adres, $temat, $tresc_maila, $head);
}