Home > Backend Development > PHP Tutorial > Controller_PHP tutorial for PHP framework

Controller_PHP tutorial for PHP framework

WBOY
Release: 2016-07-13 17:49:35
Original
1974 people have browsed it

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)


Excerpted from Internet Marketing

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478346.htmlTechArticleRecently I was doing SAE online 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 is very...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template