コード例 #1
0
ファイル: route.php プロジェクト: pashakiz/crowdf
 /**
  * Prepare a link to discover page.
  *
  * @param array $params Parameters that should be added to the URI.
  *
  * @return string
  */
 public static function getDiscoverRoute($params = array())
 {
     $needles = array('discover' => array(0));
     //Create the link
     $link = 'index.php?option=com_crowdfunding&view=discover';
     if (!empty($params)) {
         $link .= CrowdfundingHelper::generateUrlParams($params);
     }
     // Looking for menu item (Itemid)
     if ($item = self::findItem($needles)) {
         $link .= '&Itemid=' . $item;
     } elseif ($item = self::findItem()) {
         // Get the menu item (Itemid) from the active (current) item.
         $link .= '&Itemid=' . $item;
     }
     return $link;
 }