I have a main view with a menu which helps me display another view. It’s similar to this:
<div id="page">
<div id="menu">
<a href="controller/page1">Page1</a>
<a href="controller/page2">Page2</a>
</div>
<div id="content">
<!-- Page1 or Page2 are displayed here -->
</div>
</div>
I’m using php’s Yii framework. Which makes me not to use <?php include("menuview.php"); ?>. So I’m looking for a different solution. I can do this with Ajax, but I would also like the link to change to mypage/controller/Page2. With Ajax I can only get it to this: mypage/controller/index#Page2
in main view, instead of include do
UPDATE:
protected/views/controller/page1.php and protected/views/controller/page2.php content at your liking
protected/views/layouts/custom.php:
protected/controllers/ControllerController.php:
UPDATE2:
If you need the link in address bar to change too then your only option is to use regular link and not ajax
<?php echo CHtml::link('Page1', array('controller/page1')); ?>using ajax the preferred way is using hash like you mentioned.