Recently I was playing with SAE Internet Marketing Training (Sina’s cloud computing platform), so I went back to PHP. I planned to write a Weibo application, so during the writing process I found that the simple controller mechanism can easily make the code very confusing. So I thought about improving the control method. I used to think that the controller only needs to simply map the URL to a function or something else, and then the subsequent work is completely ignored. Now I think of another control:
function boot( $func ) {
$context = array ();
while ( $func = $func ( $context )) {
;
}
}
boot( function (& $context ) {
$context [] = 'A' ;
Return function (& $context ) {
$context [] = 'B' ;
Return function (& $context ) {
$context [] = 'C' ;
return function (& $context ) {
var_dump( $context );
};
};
};
});
?>
The above is a conceptual skeleton (fblww-1230)