0

I have implemented Zend_Lucene in my first Zend Framework Project, but since I have implemented Routes the Search Results does not seem to work anymore.

In my Search Result view, I have changed the URL to the Postdetails to use the Route:

<a href="<?php echo $this->url(array('post' => $value['post_id'], 'postname' => $value['post_title']), 'postdetails', true); ?>">

Unfortunately it does not seem to work, instead it shows me

<a href="/%3C%21DOCTYPE+html+PUBLIC+....... 

I normally also use

$this->escape($value['post_title'])

but again, it shows something with DOCTYPE. I don't understand enough about ZF to know what goes wrong. Can someone give me a hint? Thank you very much in advance!

Luka
  • 748
  • 2
  • 9
  • 36

1 Answers1

0

Have you tried using your named route without setting the reset option to true? I think you might be contradicting your self. You are telling the url helper to use a named route at the same time telling it to use the default routes. if you haven't already try:

<a href="<?php echo $this->url(array('post' => $value['post_id'], 'postname' => $value['post_title']), 'postdetails'); ?>">

you also may need to set default values for post and postname in your route(if you haven't already)

RockyFord
  • 8,529
  • 1
  • 15
  • 21
  • I tried it out but still does not work. I understood the reset option anyway in a different way, but might be wrong. Looking in the Code it says about reset... "Whether or not to reset the route defaults with those provided" When I want to use a URL without any routes, than I have to enter 'default' as a Routename, instead in my case 'postdetails' Correct me if I am wrong on this. Any other ideas what I could try out? – Luka Mar 05 '12 at 09:50
  • @Luka what is actually in your $value array? Also post your route definition. – RockyFord Mar 06 '12 at 00:02
  • I found the reason for the Problem. In my Action where I read out the Index, I had the following part $query->highlightMatches($result->postTitle); highlightMatches caused the issue, since this is creating some HTML. That took me 5 days to figure this out :( – Luka Mar 07 '12 at 16:18