当前位置: 首页>>代码示例>>PHP>>正文


PHP Call::form方法代码示例

本文整理汇总了PHP中Call::form方法的典型用法代码示例。如果您正苦于以下问题:PHP Call::form方法的具体用法?PHP Call::form怎么用?PHP Call::form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Call的用法示例。


在下文中一共展示了Call::form方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 public function indexAction()
 {
     $model = new SettingsModel();
     $form = Call::form('Index');
     $countrysList = $model->getCountryList();
     if (isPost()) {
         if ($form->isValid(allPost()) and (isset($form->data["email"]) or isset($form->data["password"]) and isset($form->data["password1"]))) {
             if (Request::getParam('user')->password == md5($form->data['password'])) {
                 $data = [];
                 if ($form->data['password1'] != '') {
                     $data['password'] = md5($form->data['password1']);
                 }
                 if (isset($form->data['email'])) {
                     $data['email'] = $form->data["email"];
                 }
                 if ($form->data['news'] == 1) {
                     $data['newsletter'] = $form->data["news"];
                 }
                 $model->setSettings(Request::getParam('user')->id, $data);
                 redirect(url('settings'));
             }
         } else {
             $this->view->error = printError($form->error, 'INDEX_ERROR_');
         }
     }
     $this->view->countrysList = $countrysList;
     $this->view->title = Lang::translate('INDEX_TITLE');
 }
开发者ID:terrasystems,项目名称:csgobattlecom,代码行数:28,代码来源:Controller.php

示例2: lang_newsAction

 public function lang_newsAction()
 {
     $model = new AdminModel();
     $form = Call::form('Lang_news');
     $news = $model->getNewsByID(Request::getUri()[0]);
     if (!$news->id) {
         error404();
     }
     if (isPost()) {
         $dataPost = array('name' => post('name'), 'lang' => 'en', 'text' => post('text'));
         // allPost()
         $lnid = post('lnid', 'int');
         if ($form->isValid($dataPost)) {
             $data = $form->data;
             $data['nid'] = $news->id;
             $data['uid'] = Request::getParam('user')->id;
             $data['time'] = time();
             if ($lnid) {
                 $model->update('news_lang', $data, "`id` = '{$lnid}'");
                 setNotice(Lang::translate('LANG_NEWS_EDITED'));
             } else {
                 $id = $model->insert('news_lang', $data);
                 $lnid = $id;
                 if ($id) {
                     setNotice(Lang::translate('LANG_NEWS_ADDED'));
                 }
             }
             $dataImg['path'] = 'public/news/';
             $dataImg['new_name'] = $lnid;
             $dataImg['resize'] = 2;
             $dataImg['mkdir'] = true;
             $dataImg['min_width'] = 600;
             $dataImg['min_height'] = 400;
             if ($_FILES['image']['name']) {
                 $f = File::LoadImg($_FILES['image'], $dataImg);
             }
         } else {
             setNotice(Lang::translate('SOME_ERROR'));
         }
         //redirect(url('admin', 'lang_news', $news->id));
     }
     $this->view->list = $model->getLangNewsList($news->id);
     $this->view->news = $news;
     $this->view->title = $news->name;
 }
开发者ID:terrasystems,项目名称:csgobattlecom,代码行数:45,代码来源:Controller.php


注:本文中的Call::form方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。