What is mvcl design pattern in open-cart? - opencart

What is MVCL design pattern in open-cart, i heard about mvc (model , view , controller ) but don't understand what is MVCL stand for or what is this.

MVCL means Model View Controller Language
The controller brings the text stored in the language file, and turns them into variables that can be echoed in the template file to displayed text. This is especially useful for managing translations.

Related

Is document/view architecture in MFC basically a Model/View/Controller pattern but without the controller?

Is the document/view architecture in MFC really a Model/View/Controller pattern without the controller part?
I'm studying MFC and I simply love it to bits. I know is somewhat outdated and somewhat bit more difficult to use, but I discovered that it gives me so much more power and performance gain when compared to QT.
Am I correct to think of the MFC doc/view model as simply MVC without the Controller part?
The Model/View/Controler has the following components:
Model
View: responsible to show the model to the user
Controller: responsible to get user input and translate it in operations on the model
MFC's Document/View has only 2 components:
The document, which is in fact our model
The View, which has the responsibility to show the Document AND interpret the user's commands. So it is the view+controller (refer to section Variants in this MSDN article)
Let's look at it:
The view contains UI code, both for rendering the data and for taking input from the user.
The document contains the serialization code.
From that perspective, there's just a separation between UI and a backend. However, there's more, because you can have multiple different views on the same document. You could also use the document to just provide data storage and put any actual program logic into the view. In particular when you only effectively use a single view per document, it is easy to blur the separation in practice.
In summary, I wouldn't say the MVC controller part is missing but that it's merged with the MVC view parts into the MFC view.

Writing translatable static web pages using Django

I am a bit confused on the best way to handle this problem:
My web site needs read-only static web pages (typically the About part of a web site) with 2 simple constraints:
they need to be translated
they need to have flexible layout: to incorporate base headers/footers, floating images and/or tables, and non-interactive elements (like a bootstrap carousel).
Several solutions that I have thought about:
I can of course directly write HTML files but the translation part will be awkward (a lot of <h1>, <ul>, <li> and <p> which are of no interest to the translator).
I can use Django flatpages with some markup languages but I lose a lot of flexibility (for instance template tags are not recognized)
Use generators like Hyde, but it seems quite overkill for my needs and internationalization seems a bit difficult
Does someone have other propositions that I can look into ?
Thanks !
Use django-cms, it has a Page model that can be translated and has a very smart plugin system to add many content-types into every page.
I use it a lot and it's very easy and yet powerful
For completeness and fairness, here's a full list of available CMS packages for Django.
for a much simpler solution, I would create a model called "Page" with lets say title and text fields.
The title and the text fields I would register to django-modeltranslation which will handle the translation issue.
For the text field i would use TinyMCE which let you insert basically any HTML you want so you can do whatever you need.

MVC pattern in django

This issue has been tormenting me for a while already. I've read about this topic but nothing seems to clear my thoughts. I understand that they call the views templates, and the models models as well, what I don't really get is where the controllers are. What django calls views seem to me more like actions/methods/functions of a controller than a controller itself, but anywhere I read, I find that supposed view-controller equivalency.
I've worked with MVC frameworks before (ASP.NET MVC3, Ruby on Rails, PHP Laravel Framework), and they all define the controllers as the same thing: a bunch of functions related to a specific topic of the site, namely user accounts or something like that. The best equivalency that I find between this description and django features are the apps, but of course I'm wrong due to the huge amount of people and documentation going the other way.
Could anybody help me with this? Does my mindset make any sense? Am I missing something essential here and then I can't get these concepts right?
It's a mistake to think of design patterns like MVC as unbreakable rules. They really aren't: there are all sorts of ways of implementing them, which comply with the description to a greater or lesser extent.
This is especially the case in Python, where one of the guiding principles is "practicality beats purity" - in other words, do what works.
In any case, Django makes no claim to be an MVC framework. On the contrary, the documentation describes it as MTV: model, template, view. After all, outside the world of design patterns everyone calls "an HTML file with syntax for variables and flow control" a template, not a view.
(That FAQ entry also offers a possible answer to your question: the controller is the framework itself. But it goes on to emphasise that it's a mistake to try to shoehorn into these definitions.)
The views.py defines the view functions for your app and your app groups related functions together.
However what I believe you're missing here is the urls.py.
The urls file is the first part of the controller.
The URL patterns inside urls.py dictates what you're allowed to pass in to the view function or view class (depending on what approach you took, either with function based views or class based views) and then routes it to the proper view function.
So there's tight a coupling between the views.py and the urls.py, that makes up for the entire Controller part of MVC.
Comparing it to Rails, would be that the urls.py is a routes.rb and the actual controller class is the views.py function/cbv.
The mismatch of terminology is unfortunate but more or less doing the same thing.
You can read the Django FAQ. It explains the how MVC is implemented in django. Regarding controller Django has an answer as:
.
Where does the “controller” fit in, then? In Django’s case, it’s probably the framework itself: the machinery that sends a request to the appropriate view, according to the Django URL configuration.
Could anybody help me with this? Does my mindset make any sense? Am I missing something essential here and then I can't get these concepts right?
The only well-defined parts of MVC where nearly everyone had some sort of consensus is the M; the V and C means completely different things in different web frameworks, to the point where MVC framework really only means as not having all your code in one spaghetti (ala typical classical PHP code). You just had to accept that MVC isn't a really well defined term.
Django is not strictly speaking MVC.
I found this discussion very enlightening:
Django is not MVC
Realy guys:
DJANGO is MVC!
But word View use for Controller.
And Django is Full MVC, but
Model - Model
View - Template
Comtroller - View

What are Ember.Controllers used for?

I'd like some examples please of how you use Ember.Controller objects. Apart from the StateManager, I really don't find myself using Ember.Controllers much at all. In the Ember source code it says that actions should be sent to the controller, but I really don't find myself using these so much, because I abstract the views so much, and therefore use the in-built actions like click, change, and keyUp. Am I abstracting too much?
For instance, if I'm displaying a button on the page, then I'll create a new Ember.View in my controller view, and then simply include that on the page.
Most direct interaction with controllers is indeed through the StateManager/Router. The controller's main responsibility is to present data to the views for rendering. They do this by proxying to models as well as maintaining transient state.
You are also correct that a single controller can often be responsible for a hierarchy of views.
I recently did a talk about the responsibilities of various layers in Ember apps. Slides are here: http://www.lukemelia.com/devblog/archives/2012/08/23/architecting-ember-js-apps/
This website has a pretty good presentation of how to use each part of Ember's MVC, and their relationship with each other:
http://www.lukemelia.com/blog/archives/2012/08/23/architecting-ember-js-apps/

MVC pattern in Qt4 - how to organize code besides using Interview

i was recently suggested to use MVC pattern to organize my Qt4 application.
I'm a little puzzled :).
How do I implement:
1. model
2. view
3. controller
In HTTP based apps its quite straigtforward. But here I'm not sure what is a view and what is a controller ?
Lets asume that I'm not using Interview right now.
Thanks for help
you can look at this like this:
Controller is the window/form that You created. Member functions in this class should handle all user input and call apropriate member functions in your model.
Model is your class that handles data and implements other logic.
Views are qt widgets used to design your forms/windows
(You could also treat *.ui files as views and Classes that are bound with ui files as controllers)
Hope this helps.