The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Apr 18, 2012 1:12 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Apr 18, 2012 1:04 am
Posts: 2
For example I understand how works the MVC router, the request is send on http://www.somesite.com/someArticle/5 - then this is rerouted to show.php/5, but i dont' understand how this works in joomla, i am about components, can you explain me please!!!

but what does this code:

Code:
function BannersBuildRoute( &$query )
{
   $segments = array();

   if (isset($query['task'])) {
      $segments[] = $query['task'];
      unset( $query['task'] );
   }
   if (isset($query['bid'])) {
      $segments[] = $query['bid'];
      unset( $query['bid'] );
   }

   return $segments;
}


and then this:

Code:
function BannersParseRoute( $segments )
{
   $vars = array();

   // view is always the first element of the array
   $count = count($segments);

   if ($count)
   {
      $count--;
      $segment = array_shift( $segments );
      if (is_numeric( $segment )) {
         $vars['bid'] = $segment;
      } else {
         $vars['task'] = $segment;
      }
   }

   if ($count)
   {
      $count--;
      $segment = array_shift( $segments) ;
      if (is_numeric( $segment )) {
         $vars['bid'] = $segment;
      }
   }

   return $vars;
}



maybe is an old and stupid question, but i really don't understand, how can i use this if i create MY OWN TABLE???, what option i need to change??, what if i want to get some fields of the database, not all, only the selected??


Last edited by imanickam on Wed Apr 18, 2012 1:51 am, edited 1 time in total.
Moved topic » from General Questions/New to Joomla! 2.5 / Joomla! 1.7 to Joomla! 2.5 / 1.7 Coding


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 



Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group