Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-30-2008, 10:14 PM
Junior Member
 
Join Date: Jun 2008
Posts: 7
Default Url problem

Hi all,

I just recently started using Zend framework, so sorry if this is a stupid question.

I'm trying to create urls using $this->url() in my views. So for example, in one view I have
PHP Code:
<a href="<?=$this->url(array('controller'=>'profile''action'=>'view'))?>">View profile</a>
And on another I have
PHP Code:
<a href="<?=$this->url(array('controller'=>'profile''action'=>'post' 'id'=>2))?>">View profile</a>
The idea is that the link to the first page is /baseurl/profile/view, and the link to the second is /baseurl/profile/post/id/2. But then any links I have on the second page have //id/2 added to the end of them. It seems that any extra parameters I add to the url are automatically appended to any urls on that page.

Again, sorry if I'm missing something obvious, I just can't seem to figure out what I'm doing wrong.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-01-2008, 12:39 PM
Junior Member
 
Join Date: Jul 2008
Posts: 6
Default

<a href="<?=$this->url(array('controller'=>'profile', 'action'=>'post' , 'id'=>2))?>">View profile</a>


try this , your forget " , " before 'id' .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-03-2008, 12:57 PM
Junior Member
 
Join Date: Jun 2008
Posts: 7
Default

Thanks for the reply, seems that I mistyped it when I was writing it here, I'm too dependent on IDEs lol, I had it typed correctly in my actual app

But I found a fix to the problem I was having, I just needed to add a couple of extra parameters to the url() function:
PHP Code:
<?=$this->url(array('controller'=>'profile''action'=>'view'), nulltrue)?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:33 PM.