joomla URI

Creating get string in joomla component development.

$uri = "index.php?option=com_qc&view=edit";
$u =& JURI::getInstance( $uri );

$params = array( 'task' => 'hello',
'data' => 'hitoall'
$params = array_merge( $u->getQuery( true ), $params );
$query = $u->buildQuery( $params );
$u->setQuery( $query );
$editlnk = $u->toString();

Now, you can write some url redirect code to go to the url you created or something else.
just echo $editlnk and you can see link like “index.php?option=com_qc&view=edit&task=hello&data=hitoall”; I find this thing useful creating a component which create multiple dynamic link in same page.

  • spyjoomla

    This is gr8.