Welcome Guest, Not a member yet? Register   Sign In
An alternative way to send variables to functions?
#16

[eluser]Lima[/eluser]
Yeah it's possible for you
just do this things :

modify config/config.php
Code:
$config['permitted_uri_chars'] = '';

make helpers to easy access like this
Code:
if (! function_exists('get_request_data'))
{
  function get_request_data($names, $default=null, $xss_clean=FALSE)
  {
    $rtn = array();
    if (is_array($names)) foreach ($names as $i => $v)
    {
      if (isset($_REQUEST[$v])) $rtn[$v] = $xss_clean ? xss_clean($_REQUEST[$v]) : $_REQUEST[$v];
      else $rtn[$v] = isset($default[$v]) ? $default[$v] : null;
    }
    elseif (isset($_REQUEST[$names])) $rtn = $xss_clean ? xss_clean($_REQUEST[$names]) : $_REQUEST[$names];
    else $rtn = $default;

    return $rtn;
  }
}

from your controller just call helper

http://www.yoursite.com/welcome/home/?va...ar2=value2
Code:
$data = get_request_data(array('var1', 'var2', 'var3'), array('default1', 'default2', 'default3'));

or

$data = get_request_data('var1', 'default1');

hope this can help.


Messages In This Thread
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 02:45 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 02:53 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 02:58 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 03:04 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 03:38 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 03:39 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 03:46 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 03:48 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 03:50 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 03:52 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 03:56 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 03:57 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 04:00 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 04:07 PM
An alternative way to send variables to functions? - by El Forum - 03-30-2008, 11:35 PM
An alternative way to send variables to functions? - by El Forum - 04-06-2008, 01:38 AM
An alternative way to send variables to functions? - by El Forum - 04-06-2008, 02:34 AM
An alternative way to send variables to functions? - by El Forum - 04-06-2008, 02:37 AM
An alternative way to send variables to functions? - by El Forum - 04-07-2008, 04:40 PM
An alternative way to send variables to functions? - by El Forum - 04-10-2008, 04:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB