Welcome Guest, Not a member yet? Register   Sign In
Simpler way to remove link [uri->segment()]
#3

[eluser]carvingCode[/eluser]
Thanks. Indeed a simpler way.

I made a slight modification to handle a 'controller/function' type of menu call.

Code:
function show_menu($data_array, $first_uri_segment, $second_uri_segment) {

        foreach ($data_array as $key => $val) {
            if ($second_uri_segment == $key) {
                echo "<li>" . $val . "</li>";
            } else {
                echo "<li>" . anchor($first_uri_segment . "/" . $key, $val) . "</li>";
            }
        }
    }

$this->cc_functions->show_menu($data, $this->uri->segment(1), $this->uri->segment(2));

I placed the function in a custom library in my project, hence the 'cc_functions' in the function call statement.

Thanks!

Randy


Messages In This Thread
Simpler way to remove link [uri->segment()] - by El Forum - 02-03-2011, 11:51 AM
Simpler way to remove link [uri->segment()] - by El Forum - 02-03-2011, 03:17 PM
Simpler way to remove link [uri->segment()] - by El Forum - 02-04-2011, 07:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB