當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Meta::search方法代碼示例

本文整理匯總了PHP中Meta::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Meta::search方法的具體用法?PHP Meta::search怎麽用?PHP Meta::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Meta的用法示例。


在下文中一共展示了Meta::search方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: register

 /**
  * @before _session
  * @after _csrfToken
  */
 public function register()
 {
     $this->seo(array("title" => "Publisher Register", "description" => "Register"));
     $view = $this->getActionView();
     $view->set('errors', []);
     $afields = Meta::search('customField', $this->org);
     $view->set('afields', $afields ?? []);
     $token = RM::post("token", '');
     if (RM::post("action") == "register" && $this->verifyToken($token)) {
         $this->_publisherRegister($this->org, $view);
     }
 }
開發者ID:vNative,項目名稱:vnative,代碼行數:16,代碼來源:publisher.php

示例2: customFields

 public static function customFields($user, $org)
 {
     $afields = \Meta::search('customField', $org);
     if (count($afields) > 0) {
         $meta = $user->meta ?? [];
         $extraFields = [];
         foreach ($afields as $value) {
             $key = $value['name'];
             $type = $value['type'];
             $message = $value['label'] . " is required!!";
             switch ($type) {
                 case 'file':
                     $v = Utils::media($key, 'upload', ['extension' => 'jpe?g|gif|bmp|png|tif|pdf']);
                     if (!$v) {
                         $message = "Please Upload a valid image or pdf file";
                     }
                     break;
                 case 'text':
                     $v = RequestMethods::post($key);
                     break;
                 case 'date':
                     $d = RequestMethods::post($key, date('Y-m-d'));
                     $v = Db::convertType($d, 'date');
                     break;
                 default:
                     $v = '';
                     break;
             }
             if (!$v && $value['required']) {
                 return ["message" => $message, "success" => false];
             }
             $extraFields[$key] = $v;
         }
         $meta['afields'] = $extraFields;
         $user->meta = $meta;
     }
     $user->save();
     return ["success" => true];
 }
開發者ID:vNative,項目名稱:vnative,代碼行數:39,代碼來源:user.php

示例3: resetpassword

 /**
  * @before _session
  */
 public function resetpassword($token)
 {
     $this->seo(array("title" => "Forgot Password", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $meta = Meta::search('resetpass', (object) ['value' => $token]);
     if (!$meta) {
         $this->redirect("/");
     }
     // @todo install reCaptcha
     if (RM::post("action") == "change") {
         $pass = RM::post("password");
         $user = User::first(array("id = ?" => $meta->propid));
         if ($pass == RM::post("npassword")) {
             $user->password = sha1($pass);
             $user->save();
             $meta->delete();
             $view->set("message", 'Password changed successfully now <a href="/login.html">Login</a>');
         } else {
             $view->set("message", 'Password Does not match');
         }
     }
 }
開發者ID:vNative,項目名稱:vnative,代碼行數:25,代碼來源:auth.php


注:本文中的Meta::search方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。