Welcome Guest, Not a member yet? Register   Sign In
Call Controller method in View
#1

[eluser]Aspi[/eluser]
Hi Everybody!

The question is ther is any chance i call controller method in view.
Because i would like build form dinamyc with ACL.
ACL in database every form component ther is 3 state enable,disable,hidden.

I would like use Like build_text,build_calendar,build_ .... method

Thanks for your help
#2

[eluser]toopay[/eluser]
Why you dont try to turn it over. Instead process that in your view files, you should try to processing authorization in your controller (or auth modules), get user permission by some ACL rules, then passed it result to some template manager for example. It will be more efficient nor secure (considering ACL is something that layered user permission & access), i believed.
#3

[eluser]haileCI[/eluser]
[quote author="Aspi" date="1301492467"]Hi Everybody!

The question is ther is any chance i call controller method in view.
Because i would like build form dinamyc with ACL.
ACL in database every form component ther is 3 state enable,disable,hidden.

I would like use Like build_text,build_calendar,build_ .... method

Thanks for your help[/quote]

may like :

<? echo $mytable=site_url('yourcontrller/method')?>;

function method()
{
//do what you want to out put to the view
echo 'what i what ';
}
#4

[eluser]danmontgomery[/eluser]
Code:
$CI =& get_instance();
echo $CI->some_controller_function();




Theme © iAndrew 2016 - Forum software by © MyBB