Yii Framework Forum: Navigation In Yii Structure? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Navigation In Yii Structure? Rate Topic: -----

#1 User is offline   clonevn 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 111
  • Joined: 25-March 13

  Posted 27 April 2013 - 01:36 PM

I dont know about the navigation of yii framework like URL manager, can anyone explain for me about this? For example here is code for login action:
if(isset($_POST['LoginForm']))
		{
			$model->attributes=$_POST['LoginForm'];
			// validate user input and redirect to the previous page if valid
			if($model->validate() && $model->login())
				$this->redirect(Yii::app()->user->returnUrl);

If I dont want to move back to login page but change to another page, is there any way to do it? Basically, I have 2 pages which have path: yii/site/model/index ( Model class was generated by CRUD) and yii/main/index (I created myself).
0

#2 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 27 April 2013 - 01:43 PM

I am fairly certain that a search for 'redirect' alone would give you a lot of examples.
Far more than I am able to provide.

I assume that you have read the Yii guide?
"Less noise - more signal"
0

#3 User is offline   clonevn 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 111
  • Joined: 25-March 13

Posted 27 April 2013 - 09:22 PM

Thank you for your answer, but the thing here is if I use redirect($path) then when I upload it to the host I have to re-config it to suit with the host. So can I do something like redirect(Yii::app()->itProperties) that allow me to go anywhere (assume that all others folder are created and configured following the MVC of yii)?
One more thing is about the mainmenu, it is stick with the main.php page not as a part of content section. So currently I have to make a statement for it like:
if ( action == done)  (or userAuthorized == true)
(<?php $this->widget('zii.widgets.CMenu',array(
			'items'=>array( newItem
			),
		)); 
else $this->widget('zii.widgets.CMenu',array(
			'items'=>array( defaultItem
			),
		)); 

It would become complex when there are many actions or users which lead to the change of mainmenu.I would like to do something like when I log-in as admin, it must change to main/index and also has new mainmenu. Please help :).
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users