New Styles & Model for upcoming Version 1.2

Discussion for coding development or feature requests
Post Reply
User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

New Styles & Model for upcoming Version 1.2

Post by Brent » Thu Jan 28, 2010 11:07 am

The template system has under gone a radical change.
The old system had a structure of:
catalog/template/default/ with the following directories under the default.
content/
css/
image/
module/

The new structure will be
catalog/template/default/
content/ main controller template files
module/ module template files
shared/ commonly used routine template files

NEW
catalog/styles/default/ under the styles/default folder
css/
image/

You will have separate settings for which template folder to use and which style folder to use.
This allows more flexibility and less duplication of code. You can use different styles with the same template.
Upgrading will only require moving your existing modified CSS and Image folders to a new Styles/yourfolder/ .

Model MVC:
Version 1.2 will now have a model engine. This is a singleton class that will invoke singleton(one instance) of model classes.
The advantage is reducing the code overhead on commonly used database queries.
For example, when searching for products, many times you would use the same code to return results. Which the new method, the same code
can be reused by many controllers.
Instantiating a model class requires the same type of method as used to call a library class such as database.
It is a one line call: $this->modelclass =& $this->model->get('model_product') where model_product is your database handling class in the
catalog/model/product/ directory.

The model engine allows specifying classes in the catalog or admin directories, or will auto load unspecified model scripts.
Commonly used methods should be defined in the model engine where rarely used classes can be auto loaded.
This method is available in both catalog and admin.

The directory structure:
catalog/model/product/ or whatever directories are required under model.
Upgrading will be automatic.

New: Security MOD
All user forms in catalog and admin will now be serialized to prevent cross site scripting.

Post Reply