Welcome Guest, Not a member yet? Register   Sign In
i have several questions in CI
#1

[eluser]caustic[/eluser]
So, first of all I want to ask:

Is it possible to load several CI controllers in one main controller without matchbox or HMVC?
if not, how to use hooks with HMVC? i did not get it.

How to get access to main controller methods in hook function (post_controller_constructor in my case) when using HMVC?
Thank you.
#2

[eluser]Eric Barnes[/eluser]
That is not supported even in hmvc I believe. Why are you not using models and helpers for your shared app code?
#3

[eluser]pickupman[/eluser]
I am not sure why you would need to do this. Perhaps what you might be looking for is a main controller that has common code for all controllers. This can be done by extending the controller class. Here is Phil Sturgeon's great [url="http://philsturgeon.co.uk/news/2010/02/CodeIgniter-Base-Classes-Keeping-it-DRY"]post[/url] on this.
#4

[eluser]caustic[/eluser]
I`ll try to explain in thesises.
I want to use one temlate for several CI applications.
I want to use plug-ins approach. For example: programmist writing some controller[blog]. certan method [let`s say index/show/%user_name%] of this controller must show only 10 entries of certan user [%user_name%]. This method operates with model [blog_model] and personal view file [view_show]. In this way programmist have to write "classical" CI application and don`t have to think about authorisation, authentication and output to template - all this work will be handled by my libraries. For examlple tag cloud module or comments module have separate code.
A certan plug-in is a public method of this or another controller, proctected by "_" prefix in name. This made for using model and specific settings of controller which method called as plug-in.
sorry for my english. Smile
#5

[eluser]caustic[/eluser]
This question is temporally solved (until I have not find better decision).
Output data of main controller can be intercepted in post_controller hook point:
Code:
$CI = &get;_instance();
echo $CI->output->final_output;




Theme © iAndrew 2016 - Forum software by © MyBB