i have created a views of type "node", and add "Page" display to return page with some list of values. to my question... how do i correctly pass "PHP code" as argument in views?

just some steps i did (skipping some settings):

-add path as: sections/%
-add arguments: Provide default argument > argument type(PHP Code)

and the code within for the argument:

    $urlpath = explode('/', referer_uri()); 
    // this next line of code should pass value to (%)...
    return $urlpath[4]; //return particular path value according to array...

try to run the path as http://localhost/sections/sports (substituting % with "sports") returns empty or blank...

can anyone please help what i'm missing?...

thanks,

vsotto

Comments

vrsotto’s picture

anyone please...