MVC Call Function function.php

Source: Internet
Author: User

<?PHP//Call Function C of the controller    functionC$name,$method){        require_once('/libs/controller/'.$name.‘ Controller.class.php '); //eval (' $obj = new '. $name. ' Controller (), $obj-$method. ' (); ');        $controller=$name.‘ Controller '; $obj=New $controller(); $obj-$method.(); }    //Call function M for the model    functionM$name){        require_once('/libs/model/'.$name.‘ Model.class.php '); //eval (' $obj = new '. $name. ' Model (); ');        $model=$name.‘ Model '; $obj=New $model(); return $obj; }        //Call function for view v    functionV$name){        require_once('/libs/view/'.$name.‘ View.class.php '); //eval (' $obj = new '. $name. ' View (); ');        $view=$name.‘ View '; $obj=New $view(); return $obj; }        functionORG ($path,$name,$params=Array()){//Path is the name of the third-party class named params is the class that needs to be specified, assigned a property when initialized, in the format array (property name = = Property value, property name 2=> property value 2 ...)        require_once(' libs/org/'.$path.$name.‘. Class.php '); //eval (' $obj = new '. $name. ' (); ');        $obj=New $name(); if(!Empty($params)){        foreach($params  as $key=$value){                //eval (' $obj '. $key. ' = '. $value. ' \ '; ');                $obj-$key=$value; }        }        return $obj; }    //data used to filter illegal parameters//GET_MAGIC_QUOTES_GPC function to determine whether to invoke the Magic method//addslashes function Escape string    functionDaddslashes ($str){        return(!GET_MAGIC_QUOTES_GPC())?addslashes($str):$str; }?>

MVC Call Function function.php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.