當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。