I've been wondering about opinions, just like csdn, users can modify their own homepage style, and is a permanent change, a lot of places are invited to the view style to the user this is the trend of future development, want to QQ space dress up, and even some of the background of the construction station program is like this, so, It is very important to understand this principle.
First of all, this is obviously impossible to achieve through the front-end, because the previous paragraph of things to the user where the end is put into memory, memory is volatile, then it should be placed in the background, the same, we can not go directly to modify the background file, so the cost is very large, then put them into the database, Data in the database when the hard drive inside, not easy to lose, and through the background file is also very easy to operate, so, the idea came.
Visual management interface in the background, store a variety of styles of buttons, forms and so on, including the specific changes in the page, in the database, the store is the foreground view of the style data, which is missing a connection, but smarty perfect solution to this problem, and the separation of data, modify is the modified database data, Extraction is the extraction of the database style, which is the core principle.
Here is a copy of my instance code for reference only:
Select ();
$info->id= ' 2 ';
$info->value=$_post[value];
$info->save ();
$BG = $temp [1][' value '];
$size = $temp [4][' value '];
echo $BG;
echo "
";
echo $size;
$this->assign (BG, $BG);
$this->assign (size, $size);
$this->display ();
}
<title></title> Test Game