public function buildModel_POST() { $name = PUT('name'); if (!$name) { $this->error('模型名称不能为空'); } \Think\Build::buildModel('Api', $name); $this->success('模型生成成功', $name); }
public function mk() { if ($_POST) { if (I('controller')) { \Think\Build::buildController(I('module'), I('controller')); } if (I('model')) { \Think\Build::buildModel(I('module'), I('model')); } } $this->display(); }
protected function execute(Input $input, Output $output) { if ($input->hasOption('config')) { $build = (include $input->getOption('config')); } else { $build = (include APP_PATH . 'build.php'); } if (empty($build)) { $output->writeln("Build Config Is Empty"); return; } \think\Build::run($build); $output->writeln("Successed"); }
public function index() { //$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>!</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8'); echo "hrllo Word"; //$this->display(); // 生成Admin模块的Role控制器类 // 默认类库为Admin\Controller\RoleController // 如果已经存在则不会重新生成 \Think\Build::buildController('Home', 'Comments'); // 生成Admin模块的Role模型类 // 默认类库为Admin\Model\RoleModel // 如果已经存在则不会重新生成 \Think\Build::buildModel('Home', 'Order'); }
public function index() { //echo U('Index/index');//生成访问地址 // B('Home\Behavior\Test'); // \Think\Hook::listen('action_begin'); echo I('get.id'); $event1 = A('Index', 'Event'); $event1->testEvent(); echo "aa"; \Think\Build::buildController('Home', 'User'); \Think\Build::buildController('Home', 'Ajax'); \Think\Build::buildController('Home', 'Load'); \Think\Build::buildController('Home', 'Zhengze'); \think\Build::buildModel('Home', 'User'); print_r(C('USER_AUTH_ID')); // $data['status'] = 1;$data['content'] = 'content';$this->ajaxReturn($data); // $blogModel = M('Blog'); // $data = array(array('title'=>'tao3','content'=>'wangtao','date'=>'aaa'),array('title'=>'tao4','content'=>'wangtao','date'=>'aaa')); // $res = $blogModel->addAll($data); // dump($res); }
public function testRun() { $build = ['__dir__' => ['runtime/cache', 'runtime/log', 'runtime/temp', 'runtime/template'], '__file__' => ['common.php'], 'demo' => ['__file__' => ['common.php'], '__dir__' => ['behavior', 'controller', 'model', 'view', 'service'], 'controller' => ['Index', 'Test', 'UserType'], 'model' => ['User', 'UserType'], 'service' => ['User', 'UserType'], 'view' => ['index/index']]]; Build::run($build); $this->buildFileExists($build); }
public function buildModel() { if (IS_POST) { $name = PUT('name'); $module = PUT('module'); if (!$name) { $this->error('模型名称不能为空'); } if (!$module) { $this->error('模块名称不能为空'); } \Think\Build::buildModel($module, $name); $this->success('模型生成成功', $name); } }