当前位置: 首页>>代码示例>>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;未经允许,请勿转载。