0 Replies - 171 Views - Last Post: 16 April 2013 - 01:35 PM Rate Topic: -----

#1 cassiopeia  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 86
  • Joined: 03-April 11

Yii : how create a link in one view to another view

Posted 16 April 2013 - 01:35 PM

apologize if its a very fundamental question. i have very little knowledge either about PHP and Yii Framework. so my question is, how to create a link in one view to another view? :helpsmilie:

i did try something like this in view/skn/post/index.php, but does not work.

//controller : PostController
//view 	     : index.php
//arrive here using using PostController. skn/post/index

//i want to create URL that redirect to skn/comment/index
//but i think this way is wrong
$url_comment_index = Yii::app()->createUrl('skn/comment/index');

$this->menu=array(
	array('label'=>'Create Post','url'=>array('create')), //work fine to skn/post/create
	array('label'=>'Manage Post','url'=>array('admin')), //work fine to skn/post/admin
	array('label'=>'Approve Comments','url'=>array($url_comment_index)), 
        //url_comment_index does not work. return a wrong URL
);



its a blog application i create base on Yii Blog Example. but i want a different way redirecting app to 'Approve Comment'.

below is my folder directory

Yii Folder :
protected
------views
		------layouts
		------site
		------skn
			------comment
				------index.php
			------post
				------create.php
				------admin.php			
				------index.php



any help would be appreciete.
cheers ^^

This post has been edited by cassiopeia: 16 April 2013 - 01:42 PM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1