respond_to just like on rails |
[eluser]Unknown[/eluser]
hey guys.. when I was reading about rails, I figured out that we can get the response from the server the way we want just telling on the controller what format we want to just like that: www.example.com/aiports.js Code: class AirportsController < ApplicationController I think it is easy to implement on PHP, but the point is : how to insert the format (or extension) in front of the controller, as in "www.example.com/aiports.js". I know that must be something about rewrite in htaccess... but how? some tips?? tks !
[eluser]richthegeek[/eluser]
You could do this in the routes file, if you are doing it in CI; Code: $routes[ '([^\.]+)\.(.+)' ] = "$1/format/$2"; That's the general idea at any rate.
|
Welcome Guest, Not a member yet? Register Sign In |