Welcome Guest, Not a member yet? Register   Sign In
redirect to function when clicking a button
#6

[eluser]InsiteFX[/eluser]
Code:
<?php
$attributes = array(
    'id' => 'css id',
    'class' => 'css class',
    'title' => 'News title'
);
echo anchor('news/local/123', $mtitle, $attributes);
?>
echo anchor('news/local/param1/param2', $mtitle, $attributes);

// to pass a prameter to the method it would be like this.
controller = news

public function local($param1 = null, $param2 = null)
{
    // your code here!
}

$mtitle can be passed thru the view with $data.

InsiteFX


Messages In This Thread
redirect to function when clicking a button - by El Forum - 08-13-2011, 06:55 PM
redirect to function when clicking a button - by El Forum - 08-13-2011, 07:14 PM
redirect to function when clicking a button - by El Forum - 08-13-2011, 07:43 PM
redirect to function when clicking a button - by El Forum - 08-13-2011, 07:49 PM
redirect to function when clicking a button - by El Forum - 08-13-2011, 08:19 PM
redirect to function when clicking a button - by El Forum - 08-13-2011, 09:35 PM
redirect to function when clicking a button - by El Forum - 08-13-2011, 10:16 PM
redirect to function when clicking a button - by El Forum - 08-15-2011, 05:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB