Welcome Guest, Not a member yet? Register   Sign In
Before I Move to CodeIgniter
#1

[eluser]Unknown[/eluser]
I have a website, all the development of which I have done in Kohana. I went with Kohana initially for two reasons, I didn't know or understand OOP when I started with it and it forced me to learn it, and it has a template (skin) controller built into it.

After four and a half years of development, and moving to Kohana last summer, the site is pretty dynamic and does some amazing things for me. You can see the user side at the link below but there is also a student registrar system built out in the back and an admin site (crappy self-built admin CMS) that handles all of the user, class and show scheduling.

http://www.impatient.ca/


Templating, In The Architectural Sense
Kohana's template controller essentially acts a filter that allows me to use code that looks like this:
Code:
$this->template                 = new View('templates/main');
$this->template->header         = new View('templates/header');
$this->template->header->nav    = new View('templates/navigation');
$this->template->footer         = new View('templates/footer');

In my controllers, say, for example, to display a list of upcoming shows, I would use the following code:
Code:
$shows                          = new Show_Model;
$this->template->content        = new View('shows/upcoming');
$this->template->content->shows = $shows->get_upcoming_shows();

Because the template controller has "default" values for the footer and header, I can always overwrite them in the controller, for example, to display a different footer for a page listing classes currently in session, I can write:
Code:
$classes                        = new Class_Model;
$this->template->content        = new View('shows/upcoming');
$this->template->content->shows = $classes->get_classes_in_session();
$this->template->footer         = new View('classes/footer');

And I REALLY like that.

And I don't see an easy way to do this in the CodeIgniter User Guide, which seems kind of ridiculous to me, since I suspect most people would want global headers, footers, navigations, etc., so that you don't have to write that into EVERY view file, in the way the User Guide and video tutorials demonstrate.

Ugh.

(BTW, I run an improv and sketch comedy theatre and training centre in Toronto, so we have classes, so yes, I know Class_Model is a horrible name, but I don't have much choice.)


ExpressionEngine
The main reason I'm looking at CodeIgniter is ExpressionEngine's its ability to integrate CodeIgniter code into its system. I need to be able to write custom queries to access my data and also have to use the existing table structure. My database kicks ass, so I don't want to have to move to something I don't like, such as CakePHP requires.

There are some sections of my website, however, that would just be much easier to maintain through a CMS. I also use the same site framework for a friend's improv theatre in North Carolina. A CMS would allow him to maintain aspect of his site much better than he can now. Now he has to try to figure out what is going on behind the scenes and what text is stored in which view files, which I have tried to keep very simple and easy to understand.

Also, both my site and his have both development and production sites. EE and its multiple site manager seems to be able to do what I want in terms of making the management, re-usability and granularity of code pretty fantastic.

I pretty much know Kohana inside and out now -- they screwed me on the vast re-write to version 3, though, so I'm not too loyal.

I'd just really like to make the transition to EE, but am not able to fork out hundreds of US dollars if the ExpressionEngine/CodeIgniter dynamic duo won't be able to do what I need it to do. Can EllisLab offer me a guarantee on that?


Questions

Is there an easy way to do this?

Would I have to build a template controller on my own and use it?

If I port from Kohana to CodeIgniter, will I be wasting my time? Porting to CodeIgniter could be simple, but a complete transition to CI/EE combo might take a year. Bear in mind I do this in what time I can muster.


I thank you all for your help. The community here is one of the reasons I'm consider a switch.

Cheers,
Kevin.
#2

[eluser]wiredesignz[/eluser]
There is a View Object available for CodeIgniter and modules are available also. In fact CI will do everything KO can do if you give it a little thought. You might also consider MojoMotor CMS as a base platform.
#3

[eluser]dudeami0[/eluser]
Is there an easy way to do this?
Loader Class: CodeIgniter User Guide

Quote:$this->load->vars($array)

This function takes an associative array as input and generates variables using the PHP extract function. This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might want to use this function independently is if you would like to set some global variables in the constructor of your controller and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached and merged into one array for conversion to variables.

Would I have to build a template controller on my own and use it?
Shouldn't need to with the above.

If I port from Kohana to CodeIgniter, will I be wasting my time? Porting to CodeIgniter could be simple, but a complete transition to CI/EE combo might take a year. Bear in mind I do this in what time I can muster.
Weigh out the benefits/disadvantages. Will CodeIgniter help you save time developing? I know it does for me, but your solution would work well also.

For a CMS with codeigniter, check out PyroCMS, and CodeIgniter 2.0 will allow you to have third-party applications (From my understanding), so basically a site within a site.

Hope this helps you out!
#4

[eluser]Rick Jolly[/eluser]
The CI/EE combo might not work the way you think. You can't easily use EE within CI. You can call CI libraries/helpers from within an EE plugin/extension/module, but you could call other php code libraries just as well.

You have a lot invested in Kohana, so I'd stick with that. Use EE alongside if you like.
#5

[eluser]Unknown[/eluser]
Scheduling is an essential device for engineering and manufacturing , where it can have a amazing impact on the productivity of a process. In manufacturing, the reason of timing or scheduling is to decrease the production costs and time. Production scheduling aims to optimize the productivity of the operation and decrease costs.

.........................................................
#6

[eluser]skunkbad[/eluser]
CI has a great way of enabling the nesting of views, but you could also call $this->load->view('view_name') multiple times. See the second and third parameters of view(), and you'll see quickly how you can nest views. You can also use $this->load->vars().

For lack of a better way to describe myself, I'd think that by using a framework like Kohana, you might already be used to a more modern way to use PHP OOP, and that taking the time to learn CI might be a waste. The upsides to CI are clearly the ease of use and popularity, but you ought to investigate the CI "super object", lack of true autoloading, and other common complaints (like lack of a core authentication library).

Personally, I love CI. I've built up a foundation (Community Auth) that makes it super easy for me to get working on a project without dealing with authentication, and although I'm sick of typing "$this->" a million times in the last year, I continue to use CI for lack of wanting to figure out another framework. I haven't found anything that has made me say, "I can't provide my client with that because I'm using CodeIgniter".




Theme © iAndrew 2016 - Forum software by © MyBB