本文整理汇总了PHP中Display::hrefString方法的典型用法代码示例。如果您正苦于以下问题:PHP Display::hrefString方法的具体用法?PHP Display::hrefString怎么用?PHP Display::hrefString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::hrefString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: objectResponse
public function objectResponse($disp)
{
$changed = false;
if ($this->dynamic_attributes->isDynamic('handler')) {
if ($new = $disp->valueChanged($this->dynamic_attributes->attribute('handler'))) {
$hand = $new;
$changed = true;
} else {
$hand = Display::rsmlValue($disp->variables(), $this->dynamic_attributes->attribute('handler'));
}
} else {
$hand = $this->attribute('handler');
}
if (count($this->qs_nodes)) {
$vars = array();
foreach ($this->qs_nodes as $node) {
$vars[] = $node->templateData(RsmlNode::CTX_ARRAY_ARGUMENT);
}
eval('$get_array = array(' . implode(',', $vars) . ');');
$changed = true;
} else {
$get_array = '';
}
if ($changed && $disp->allowedHandler($hand)) {
$disp->setResponse($this->idAttribute(RsmlNode::CTX_PLAIN), 'href', Display::hrefString($hand, $disp->remoteNum(), $get_array));
if (!$this->hasAttribute('onclick')) {
$disp->setResponse($this->idAttribute(RsmlNode::CTX_PLAIN), 'onclick', RemoteDisplay::onClickString($hand, $disp->remoteNum(), $get_array));
} else {
$disp->setResponse($this->idAttribute(RsmlNode::CTX_PLAIN), 'onclick', $this->attribute('onclick', RsmlNode::CTX_PLAIN));
}
if (!$this->text_node) {
$nav = $disp->getSiteNavigation();
$item = $nav->getItem($hand);
$text = $item->displayInfoValue('text');
$disp->setResponse($this->idAttribute(RsmlNode::CTX_PLAIN), 'innerHTML', $text);
}
}
}
示例2: onClickUrl
public static function onClickUrl($handler, $remote_num, $secondary_get_vars = '')
{
if ($secondary_get_vars) {
$new_secondary_get_vars = $secondary_get_vars;
} else {
$new_secondary_get_vars = array();
}
$new_secondary_get_vars['ajax'] = true;
$new_secondary_get_vars['remote_num'] = $remote_num;
$ret = Display::hrefString($handler, $new_secondary_get_vars);
return $ret;
}
示例3: generateInputObjects
function generateInputObjects()
{
$ret = array();
$tabindex_count = 0;
foreach ($this->standard_options as $name => $values) {
if (isset($values['value'])) {
$value = $values['value'];
} else {
$value = '';
}
if (isset($values['label'])) {
$label = $values['label'];
} else {
$label = '';
}
if ($this->item_link_class) {
$secondary_get_vars = ArrayUtility::merge($this->secondary_get_vars, array($name => $value));
$href = Display::hrefString($this->item_link_class, $secondary_get_vars);
$label = new FormLink($href, $label);
} else {
$label = new FormLabel($label);
}
switch ($this->type) {
case ButtonGroup::CHECK:
$obj = new Checkbox($name, $this->class, '', $value, $label, '');
break;
case ButtonGroup::RADIO:
$obj = new RadioButton($name, $this->class, '', $value, $label, '');
break;
case ButtonGroup::NONE:
$obj = $label;
break;
}
if ($obj instanceof FormInput) {
$obj->setTabindex($this->tabindex + $tabindex_count);
}
$tabindex_count++;
}
$selected = $this->selected;
$primary_get_string = '';
$check_name = $this->name;
if (!$this->options) {
$this->options = array();
}
foreach ($this->options as $opt) {
$cur_check_name = $opt->formOptionName($check_name);
$cur_check_value = $opt->formOptionValue();
$cur_check_label = $opt->toString();
$opt->formLinkGetVars($this->secondary_get_vars);
$check_selected = ArrayUtility::arrayFromString($cur_check_name, false);
if ($this->type == ButtonGroup::CHECK || $this->type == ButtonGroup::NONE) {
$cur_check_name .= '[]';
}
if ($this->item_link_class) {
$href = Display::hrefString($this->item_link_class, $this->secondary_get_vars);
$label = new FormLink($href, $cur_check_label);
} else {
$label = new FormLabel($cur_check_label);
}
switch ($this->type) {
case ButtonGroup::CHECK:
if (count($check_selected) && is_array($check_selected)) {
$sel_array = ArrayUtility::getArrayValueMulti($selected, $check_selected);
if (!is_array($sel_array)) {
$sel_array = array();
}
} else {
$sel_array = $selected;
}
if (in_array($cur_check_value, $sel_array)) {
$is_selected = true;
} else {
$is_selected = false;
}
$obj = new Checkbox($cur_check_name, $this->class, '', $cur_check_value, $label, $is_selected);
break;
case ButtonGroup::RADIO:
if ($cur_check_value == $selected) {
$is_selected = true;
} else {
$is_selected = false;
}
$obj = new RadioButton($cur_check_name, $this->class, '', $cur_check_value, $label, $is_selected);
break;
case ButtonGroup::NONE:
$obj = new HiddenLabel($cur_check_name, $cur_check_value, $label, '');
break;
}
if ($obj instanceof FormInput) {
$obj->setTabindex($this->tabindex + $tabindex_count);
}
$ret[] = $obj;
$tabindex_count++;
}
return $ret;
}