• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cells

#1
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.
Reply

#2
It sounds like HMVC, under a different name.
Reply

#3
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).
Reply

#4
Call it whatever you like.

+1
Reply

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

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#6
That would be a good addition, whatever you call it...
+1
Reply

#7
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.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.