Hello,
How to get postback url # ?
Example : when i click the menu --> http://…com/example#app i don’t get the result in the page which i open but if i refresh the page i get the content of this page.
Thanks
Hello,
How to get postback url # ?
Example : when i click the menu --> http://…com/example#app i don’t get the result in the page which i open but if i refresh the page i get the content of this page.
Thanks
your question does not make sense. please try rephrasing it.
[b]
I have one page (Example) with a lot of paragraphs like that : ( <div id="pr1"> )( <div id="pr2"> )( <div id="pr3"> )( <div id="pr3"> )( <div id="pr4"> )
and i want to get then 4 pages (pr1, pr2, pr3, pr4).
So for i get then the content of pr1 must have one url like that : http://…com/example#pr1
so the problem is when i open this url : http://…com/example and then i click the menu of pr1 : http://…com/example#pr1 the page don’t change but if i refresh the page i get the content of pr1.!!
i wish that you understood me
Thanks[/b]
What I ended up doing for my tabs was using a get parameter parameter instead of an anchor - because it also allows me to ‘remember’ or link directly to it.
Controller:
$tabs = array(
array('name' => 'information', 'partial' => 'update', 'label' => 'Information'),
array('name' => 'members', 'partial' => 'settings/members', 'label' => 'Members'),
array('name' => 'versions', 'partial' => 'settings/versions', 'label' => 'Versions'),
array('name' => 'categories', 'partial' => 'settings/issue_categories', 'label' => 'Issue categories'),
array('name' => 'repositories', 'partial' => 'settings/repository', 'label' => 'Repositories'),
);
$selected_tab = $tabs[0]['name'];
if (isset($_GET['tab'])) {
$selected_tab = $_GET['tab'];
}
View:
<?php
if(isset($_GET['tab'])) {
$this->pageTitle = $information->name . ' - Settings - ' . ucfirst($_GET['tab']);
} else {
$this->pageTitle = $information->name . ' - Settings - Information';
}
?>
<h3 class="settings">Settings</h3>
<div class="tabs">
<ul>
<?php foreach($tabs as $tab): ?>
<?php if($tab['name'] == $selected_tab): ?>
<li><?php echo CHtml::link($tab['label'], '/projects/'.$_GET['identifier'].'/settings'.'?tab='.$tab['name'], array('class' => 'selected')); ?></li>
<?php else : ?>
<li><?php echo CHtml::link($tab['label'], '/projects/'.$_GET['identifier'].'/settings'.'?tab='.$tab['name']); ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
<?php foreach($tabs as $tab): ?>
<?php if($tab['name'] == $selected_tab): ?>
<?php echo'<div ?tab='.$tab['name'].' class="tab-content">';
$this->renderPartial($tab['partial'], array('model' => ${$tab['name']}, 'name' => $information->name));
echo '</div>';
?>
<?php else : ?>
<?php echo'<div ?tab='.$tab['name'].' class="tab-content" style="display:none;">';
$this->renderPartial($tab['partial'], array('model' => ${$tab['name']}, 'name' => $information->name));
echo '</div>';
?>
<?php endif; ?>
<?php endforeach; ?>
If that’s not what you’re looking for, then just ignore me.
Here’s one way of using anchors with Yii - a link tag and an a tag:
<?php echo CHtml::link('#'.$comment_count, '#note-'.$comment_count); ?>
<?php echo CHtml::tag('a', array('name' => 'note-'.$comment_count),'.'); ?>