Welcome Guest, Not a member yet? Register   Sign In
Using libraries alongside models
#1
Question 

Hi Guys!

I'm just curious to know, as I would like to ensure that I use the best possible practices when creating applications.

So here's conundrum, I have a home controller, In this controller I would like to store the latest products from the products controller.

Now from the home controller I can't directly access the product controller. Now, I've created a templating engine as a library, now I would like to be able to say something like {% latest_blogs(9) %} in my home view. Now don't worry about the template engine too much it's just the main reason I need to ask whether my approach is acceptable. However I feel like I would have the same problem even If I wasn't calling it from the view and attempted to call it from the controller.

Anyway, as noted, I basically need access to the product controller whether the access is from my view or controller in this case. Now, Is it OKAY to create a products library with it's own model or even the model of the products controller?

If not how else can I approach this? I mean, I could load the model into the controller too but I don't know how to approach this in the best possible way.

Some advice would be fantastic,

Thanks,
Matt.
Reply


Messages In This Thread
Using libraries alongside models - by mdixon18 - 03-29-2015, 04:06 PM
RE: Using libraries alongside models - by RWCH - 04-03-2015, 07:17 AM
RE: Using libraries alongside models - by gadelat - 04-03-2015, 08:31 AM
RE: Using libraries alongside models - by RWCH - 04-07-2015, 03:44 AM
RE: Using libraries alongside models - by RWCH - 04-07-2015, 03:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB