Welcome Guest, Not a member yet? Register   Sign In
Getting the requested "format" from a route
#3

[eluser]Michael Wales[/eluser]
Code:
$format = substr($this->uri->string(), strpos($this->uri->string(), '.'), len($this->uri->string()) - strpos($this->uri->string()));

This should return html or xml from the submitted URI. It may include the period, in which case you can just add 1 to the second substr() parameter (where it uses strpos()).


Messages In This Thread
Getting the requested "format" from a route - by El Forum - 12-12-2007, 04:44 PM
Getting the requested "format" from a route - by El Forum - 12-13-2007, 12:20 AM
Getting the requested "format" from a route - by El Forum - 12-13-2007, 01:36 AM
Getting the requested "format" from a route - by El Forum - 12-13-2007, 02:01 AM
Getting the requested "format" from a route - by El Forum - 12-14-2007, 12:09 AM
Getting the requested "format" from a route - by El Forum - 12-14-2007, 03:01 AM
Getting the requested "format" from a route - by El Forum - 12-14-2007, 09:09 AM
Getting the requested "format" from a route - by El Forum - 12-14-2007, 06:04 PM
Getting the requested "format" from a route - by El Forum - 12-14-2007, 06:06 PM
Getting the requested "format" from a route - by El Forum - 12-14-2007, 09:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB