In Joomla, SEF Url Conversion query not get View and layout

161 Views Asked by At

I Newly to develop a Component with SEF Feature.

I Pass Following query for route.php

JRoute::_('index.php?com_example&view=profile&layout=item_interestonme&id='.$itemval["profile_id"]); 

In route.php,

$query display Array ( [Itemid] => 114 [option] => com_example ) 

Only. view, layout, id not display. how to fix this issue.

1

There are 1 best solutions below

0
jonasfh On

There is a preprocess method in the Router-interface, defined like this:

 /**
 * Prepare-method for URLs
 * This method is meant to validate and complete the URL parameters.
 * For example it can add the Itemid or set a language parameter.
 * This method is executed on each URL, regardless of SEF mode switched
 * on or not.
 *
 * @param   array  $query  An associative array of URL arguments
 *
 * @return  array  The URL arguments to use to assemble the subsequent URL.
 *
 * @since   3.3
 */
public function preprocess($query);

You could try to override this in route.php. Perhaps the display-parameter is stripped from the query in the default implementation?