tags:

views:

21

answers:

1

Hi,

i have this line below that shows a link to go the next page of a list.

<a href="#" onclick="new Ajax.Updater('lista_miembros',
'/frontend_dev.php/miembros/filtrar?page=2')">Next page</a>

The problem: as expected, it only works in the development enviroment of the frontend (frontend_dev.php).

My question: what should i to get it work on both enviroments (production and development)? Using if's and getting the environment being used is the only way, or is there any cooler way?

Javi

+2  A: 

You should be using the url_for() function to generate your URL in your view. That way you don't need to worry about the environment, as the url string generated will handle all this for you, eg:

<a href="#" onclick="new Ajax.Updater('lista_miembros', '<?php echo url_for("@your_route"); ?>'>Next page</a>
richsage
Thanks!! it worked