Welcome Guest, Not a member yet? Register   Sign In
URI_Helper
#2

[eluser]xwero[/eluser]
I don't see the benefit of this helper? There are not so many lines in the methods and you are using the CI uri functions. For instance the get_uri method is not more code than
Code:
$get = $this->uri->uri_to_assoc(3);
if(isset($get[$key]))
{
   // do something with the value
}

I also think you can join the set_uri and set_uri_array like other functions of CI
Code:
function set_uri($data,$value=null)
{
   $array = array();
   if(is_array($data))
   {
       foreach ($data as $key => $val ){
         $array[$key]=$val;
        }
   }
   elseif(is_string($data) && $value !== null)
   {
     $array[$data]=$value;
   }
   else
   {
     return false;
   }
   return $this->uri->assoc_to_uri($array);
}

edit : if you have helpers like this you could create an extended CI class in the application/libraries directory so you don't have to autoload it.


Messages In This Thread
URI_Helper - by El Forum - 12-24-2007, 12:16 AM
URI_Helper - by El Forum - 12-24-2007, 03:31 AM
URI_Helper - by El Forum - 12-25-2007, 01:38 AM
URI_Helper - by El Forum - 12-25-2007, 03:00 AM
URI_Helper - by El Forum - 12-26-2007, 11:12 PM
URI_Helper - by El Forum - 12-27-2007, 01:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB