can i passing data from hook to view, If is it possible please explain.
for example
$hook['post_controller_constructor'][] = array(
'class' => 'Varify_user',
'function' => 'user_project',
'filename' => 'varify_project.php',
'filepath' => 'hooks',
'params' => array('')
);
i want send some array data varify_project.php(hook file) to view.
I do so
application/core/MY_Loader.php
application/config/hooks.php
If you are wanting to add additional data at the time of loading the view, you could extend the core loader class like this:
application/core/MY_Loader.php
the
$vars['hello']
would then create a variable that you can use in any view called$hello
and could be repeated to create any number of variables providing that you wanted them to be used on every page in your application.I don't have enough rep to comment splash58's answer so I'm adding this here in case it is useful to someone.
Due to _ci_object_to_array() not being available anymore and sending an error the custom loader code should be (as it is in core since 3.1.3) :