Welcome Guest, Not a member yet? Register   Sign In

(This post was last modified: 04-22-2015, 06:16 AM by gadelat.)

From CakePHP 3 docs:

"Cells are ideal for building reusable page components that require interaction with models, view logic, and rendering logic. A simple example would be the cart in an online store, or a data-driven navigation menu in a CMS. Because cells do not dispatch sub-requests, they sidestep all of the overhead associated with requestAction()."

In my opinion this allows to solve current problem in codeigniter of creating reusable logic without the need for controversial HMVC support.

It sounds like HMVC, under a different name.

At some level it is similar to HMVC, and the general concept goes under many names. I think that HMVC extensions for CI tend to group together two or three concepts: partial views, View Models/Presenters/Adapters, and a modular directory structure (modules containing their own MVC directory structure).

One of the nice things I see in CakePHP's Cells is the isolation of scope, so the Cell doesn't see the variables loaded into the view (and the view doesn't see the variables in the Cell).

Call it whatever you like.


I would call it a component!
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

That would be a good addition, whatever you call it...

I really like this idea, too. No matter what you call it.

I built a similar thing in to the view library of Sprint that takes a text string that defines the class, the method and a named parameter list. The function then tries to autoload the class (so any namespaced class works). If that doesn't work, it assumes it's a CodeIgniter library and tries to load it. It's a super simple thing that's very flexible.

I bring that up only to say that there's no reason for something like this to be nearly as structured as the way that Cake is doing it, and you can still get some great results.

Theme © iAndrew 2016 - Forum software by © MyBB