Getting started

Something you should learn to use mix2ool


Of course, the first thing you need in do in order to use mix2ool is download Mix2ool. After extracting the zip file, you will get the following skeleton.

Skeleton of Mix2ool

The outermost folder mix2ool is the container of controllers. "model" and "view" are the folders for putting your models and views respectively. You can put your js files(.js) into js folder. They will be combined into one single file if you use the source link client.js. The same for css files but this time the source link should be style.css.

"lang" folder is used to contain your language files. You may take en.lang as an example. "img" folder is used to contain all the images.

Modify .htaccess

The .htaccess file rewrite url of css and js files to the two processors style.php and js.php respectively. You should modify the content of it in order to suit your needs.

RewriteRule style.css /mix2ool/style.php
RewriteRule client.js /mix2ool/js.php

If now your folder is renamed to projectA, then these two lines should be

RewriteRule style.css /projectA/style.php
RewriteRule client.js /projectA/js.php

css/cssConfig.php and js/jsConfig.php

These two files are used for creating variables or do any server side logics which will be used in js/css files.

Writing a controller

The convention is like this. index.php serves as the dispatcher which will dynamically include the action controllers. index.default.php is the action controller with the action "default". The action is defined either by GET or POST or otherwise "default" in common.php.

Writing a view

The naming of the view is suggested to be filename.actionname.phtml which is the same as the action controller except for the file extension.

<? header("Content-Type: text/html;charset=UTF-8"); ?>
<!DOCTYPE html> 
<html lang="en"> 
	<meta charset="utf-8" /> 
<body id="index">
	<?include_once($viewPath . "header.phtml");?>

	<div class="contentBody viewport">
	<?include_once($viewPath . "footer.phtml");?>

You may see the basic HTML5 template here. In order to use html5 and mix extended tags in your view, you should always include client.js and style.css.

So now...

You should have a brief idea for Mix2ool. Now you may go to documentation page to see how to use the libraries in Mix2ool.