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


PHP ucwords函数代码示例

本文整理汇总了PHP中ucwords函数的典型用法代码示例。如果您正苦于以下问题:PHP ucwords函数的具体用法?PHP ucwords怎么用?PHP ucwords使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: doRegister

 public function doRegister(Request $request)
 {
     $validator = Validator::make($data = $request->all(), Admin::$rules, Admin::$messages);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     if ($validator->passes()) {
         $confirmation_code = Str::quickRandom(30);
         $admin = new Admin();
         $admin->fullname = ucwords($request->fullname);
         $admin->mobile_no = $request->mobile_no;
         $admin->email = $request->email;
         $admin->password = bcrypt($request->password);
         $admin->confirmation_code = $confirmation_code;
         $data = ['confirmation_code' => $confirmation_code, 'username' => $request->username, 'password' => $request->password, 'mobile_no' => $request->mobile_no];
         Basehelper::sendSMS($request->mobile_no, 'Hello ' . $request->username . ', you have successfully registere. Your username is ' . $request->username . ' and password is ' . $request->password);
         // Mail::send('emails.verify', $data, function($message) use ($admin, $data){
         // 	$message->from('no-reply@employment_bank', 'Employment Bank');
         //     	$message->to(Input::get('email'), $admin->name)
         //         	->subject('Verify your email address');
         // });
         if (!$admin->save()) {
             return Redirect::back()->with('message', 'Error while creating your account!<br> Please contact Technical Support');
         }
         return Redirect::route('admin.login')->with('message', 'Account has been created!<br>Now Check your email address to verify your account by checking your spam folder or inboxes for verification link after that you can login');
         //sendConfirmation() Will go the email and sms as needed
     } else {
         return Redirect::back()->withInput()->withErrors($validation);
         // ->with('message', 'There were validation errors.');
     }
 }
开发者ID:unicorn-softwares,项目名称:employment_bank,代码行数:31,代码来源:AdminHomeController.php

示例2: procedure_order_report

function procedure_order_report($pid, $encounter, $cols, $id)
{
    $cols = 1;
    // force always 1 column
    $count = 0;
    $data = sqlQuery("SELECT * " . "FROM procedure_order WHERE " . "procedure_order_id = '{$id}' AND activity = '1'");
    if ($data) {
        print "<table cellpadding='0' cellspacing='0'>\n<tr>\n";
        foreach ($data as $key => $value) {
            if ($key == "procedure_order_id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0" || $value == "0.00") {
                continue;
            }
            $key = ucwords(str_replace("_", " ", $key));
            if ($key == "Order Priority") {
                print "<td valign='top'><span class='bold'>" . xl($key) . ": </span><span class='text'>" . generate_display_field(array('data_type' => '1', 'list_id' => 'ord_priority'), $value) . " &nbsp;</span></td>\n";
            } else {
                if ($key == "Order Status") {
                    print "<td valign='top'><span class='bold'>" . xl($key) . ": </span><span class='text'>" . generate_display_field(array('data_type' => '1', 'list_id' => 'ord_status'), $value) . " &nbsp;</span></td>\n";
                } else {
                    print "<td valign='top'><span class='bold'>" . xl($key) . ": </span><span class='text'>{$value} &nbsp;</span></td>\n";
                }
            }
            $count++;
            if ($count == $cols) {
                $count = 0;
                print "</tr>\n<tr>\n";
            }
        }
        print "</tr>\n</table>\n";
    }
}
开发者ID:robonology,项目名称:openemr,代码行数:31,代码来源:report.php

示例3: reviewofs_report

function reviewofs_report($pid, $encounter, $cols, $id)
{
    $count = 0;
    $data = formFetch("form_reviewofs", $id);
    if ($data) {
        print "<table><tr>";
        foreach ($data as $key => $value) {
            if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0000-00-00 00:00:00") {
                continue;
            }
            if ($value == "on") {
                $value = "yes";
            }
            $key = ucwords(str_replace("_", " ", $key));
            //modified by BM 07-2009 for internationalization
            if ($key == "Additional Notes") {
                print "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . text($value) . "</span></td>";
            } else {
                print "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . xl($value) . "</span></td>";
            }
            $count++;
            if ($count == $cols) {
                $count = 0;
                print "</tr><tr>\n";
            }
        }
    }
    print "</tr></table>";
}
开发者ID:juggernautsei,项目名称:openemr,代码行数:29,代码来源:report.php

示例4: get_users

 /**
  * Ajax callback function to search users, used on exclude setting page
  *
  * @uses WP_User_Query WordPress User Query class.
  * @return void
  */
 public static function get_users()
 {
     if (!defined('DOING_AJAX') || !current_user_can(WP_Stream_Admin::SETTINGS_CAP)) {
         return;
     }
     check_ajax_referer('stream_get_users', 'nonce');
     $response = (object) array('status' => false, 'message' => esc_html__('There was an error in the request', 'stream'));
     $search = isset($_POST['find']) ? wp_unslash(trim($_POST['find'])) : '';
     $request = (object) array('find' => $search);
     add_filter('user_search_columns', array(__CLASS__, 'add_display_name_search_columns'), 10, 3);
     $users = new WP_User_Query(array('search' => "*{$request->find}*", 'search_columns' => array('user_login', 'user_nicename', 'user_email', 'user_url'), 'orderby' => 'display_name', 'number' => WP_Stream_Admin::PRELOAD_AUTHORS_MAX));
     remove_filter('user_search_columns', array(__CLASS__, 'add_display_name_search_columns'), 10);
     if (0 === $users->get_total()) {
         wp_send_json_error($response);
     }
     $response->status = true;
     $response->message = '';
     $response->users = array();
     foreach ($users->results as $key => $user) {
         $author = new WP_Stream_Author($user->ID);
         $args = array('id' => $author->ID, 'text' => $author->display_name);
         $args['tooltip'] = esc_attr(sprintf(__("ID: %d\nUser: %s\nEmail: %s\nRole: %s", 'stream'), $author->id, $author->user_login, $author->user_email, ucwords($author->get_role())));
         $args['icon'] = $author->get_avatar_src(32);
         $response->users[] = $args;
     }
     if (empty($search) || preg_match('/wp|cli|system|unknown/i', $search)) {
         $author = new WP_Stream_Author(0);
         $response->users[] = array('id' => $author->id, 'text' => $author->get_display_name(), 'icon' => $author->get_avatar_src(32), 'tooltip' => esc_html__('Actions performed by the system when a user is not logged in (e.g. auto site upgrader, or invoking WP-CLI without --user)', 'stream'));
     }
     wp_send_json_success($response);
 }
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:37,代码来源:class-wp-stream-settings.php

示例5: generateEntity

 /**
  * Función que genera los archivos de las entidades, dentro de la carpeta generation
  */
 public function generateEntity()
 {
     $tables = $this->getDatabaseTables();
     //dpr($this->)
     $route = CRITERIA_PATH_XML_CLASS_GENERATED;
     foreach ($tables as $key => $table) {
         $writeclass = "<?php\n";
         $writeclass .= "/* Class autogenerated whith PHPCriteria v1.1 */\n\n";
         $tableName = $table['Name'];
         $writeclass .= "/**\n * @Entity(Table=\"{$tableName}\")\n*/\n";
         $entityName = "Entity" . ucwords($tableName);
         $writeclass .= "class " . $entityName . " {\n\n";
         $descTable[$tableName] = $this->getDescTable($tableName);
         foreach ($this->getDescTable($tableName) as $key_t => $column) {
             $writeclass .= "\t/**\n";
             if ($column['Key'] == "PRI") {
                 $writeclass .= "\t * @Id\n";
             }
             $writeclass .= "\t * @Column(Field=\"" . $column['Field'] . "\",Type=\"" . $column['Type'] . "\",Key=\"" . $column['Key'] . "\",Null=\"" . $column['Null'] . "\",Default=\"" . $column['Default'] . "\",Extra=\"" . $column['Extra'] . "\")\n";
             if ($column['Key'] == "MUL") {
                 $fk = self::findFKGenerateEntity($tableName, $column['Field']);
                 if (count($fk) > 0) {
                     $writeclass .= "\t * @JoinColumn(Table=\"" . $fk['REFERENCED_TABLE_NAME'] . "\",Column=\"" . $fk['REFERENCED_COLUMN_NAME'] . "\")\n";
                 }
             }
             $writeclass .= "\t*/\n";
             $writeclass .= "\tpublic \$" . $column['Field'] . ";\n\n";
         }
         $writeclass .= "\tfunction __construct() {}\n";
         $writeclass .= "}\n";
         $writeclass .= "?>";
         $this->escribirArchivo($route . $entityName . ".php", $writeclass, true);
     }
 }
开发者ID:ranmadxs,项目名称:phpcriteria,代码行数:37,代码来源:CriteriaGenerate.php

示例6: addBelongsToInformation

 public static function addBelongsToInformation($model, $key, $display, $data)
 {
     if (isset($model->belongModels) && array_key_exists($key, $model->belongModels)) {
         $belongData = $model->belongModels[$key];
         if (!isset($belongData["showon"]) || static::isValidView($belongData, $display)) {
             if (!isset($belongData["model"])) {
                 throw new Exception("Model Attribute not Found in belongsModels for {$key}", 1);
             }
             if (!isset($belongData["column"])) {
                 throw new Exception("Column Attribute not Found in belongsModels for {$key}", 1);
             }
             $column = $belongData["column"];
             $modelName = ucwords($belongData["model"]);
             $belongModel = $model->belongs_to("Admin\\{$modelName}", $key)->first();
             if (isset($belongModel)) {
                 $data = $belongModel->{$column};
             } else {
                 if (isset($belongData["alternative_text"])) {
                     $data = $belongData["alternative_text"];
                 }
             }
         }
     }
     return $data;
 }
开发者ID:robriggen,项目名称:lara_admin,代码行数:25,代码来源:datahelper.php

示例7: getTaxonomyLabel

 /**
  * Retrieve the taxonomy label
  *
  * @return string
  */
 public function getTaxonomyLabel()
 {
     if ($this->getTaxonomy()) {
         return ucwords(str_replace('_', ' ', $this->getTaxonomy()));
     }
     return false;
 }
开发者ID:LiamMcArthur,项目名称:extension-fishpig-wordpress-integration,代码行数:12,代码来源:Term.php

示例8: camelCase

 public static function camelCase($str, $exclude = array())
 {
     $str = preg_replace('/[^a-z0-9' . implode('', $exclude) . ']+/i', ' ', $str);
     // uppercase the first character of each word
     $str = ucwords(trim($str));
     return lcfirst(str_replace(' ', '', $str));
 }
开发者ID:norkazuleta,项目名称:proyectoServer,代码行数:7,代码来源:Utility.php

示例9: buildClass

 /**
  * Build the model class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = $this->files->get($this->getStub());
     $tableName = strtolower($this->getNameInput());
     $className = 'Create' . ucwords($tableName) . 'Table';
     $schema = $this->option('schema');
     $fields = explode(',', $schema);
     $data = array();
     $x = 0;
     foreach ($fields as $field) {
         $array = explode(':', $field);
         $data[$x]['name'] = trim($array[0]);
         $data[$x]['type'] = trim($array[1]);
         $x++;
     }
     $schemaFields = '';
     foreach ($data as $item) {
         if ($item['type'] == 'string') {
             $schemaFields .= "\$table->string('" . $item['name'] . "');";
         } elseif ($item['type'] == 'text') {
             $schemaFields .= "\$table->text('" . $item['name'] . "');";
         } elseif ($item['type'] == 'integer') {
             $schemaFields .= "\$table->integer('" . $item['name'] . "');";
         } elseif ($item['type'] == 'date') {
             $schemaFields .= "\$table->date('" . $item['name'] . "');";
         } else {
             $schemaFields .= "\$table->string('" . $item['name'] . "');";
         }
     }
     $schemaUp = "\n        Schema::create('" . $tableName . "', function(Blueprint \$table)\n        {\n            \$table->increments('id');\n            " . $schemaFields . "\n            \$table->timestamps();\n        });\n        ";
     $schemaDown = "Schema::drop('" . $tableName . "');";
     return $this->replaceSchemaUp($stub, $schemaUp)->replaceSchemaDown($stub, $schemaDown)->replaceClass($stub, $className);
 }
开发者ID:butoibogdan,项目名称:crud-generator,代码行数:39,代码来源:CrudMigrationCommand.php

示例10: ProcessInstructor

 public function ProcessInstructor($Company_Id, $Instructor_Name)
 {
     if (!is_numeric($Instructor_Name)) {
         $Instructor_Name = ucwords($Instructor_Name);
         return $this->MakeInstructorID($Company_Id, $Instructor_Name);
     }
 }
开发者ID:InvalidC,项目名称:ClassExercise,代码行数:7,代码来源:InstructorModel.php

示例11: autoDispatch

 /**
  * autoDispatch by Volter9
  * Ability to call controllers in their controller/model/param way
  */
 public static function autoDispatch()
 {
     $uri = parse_url($_SERVER['QUERY_STRING'], PHP_URL_PATH);
     $uri = trim($uri, ' /');
     $uri = ($amp = strpos($uri, '&')) !== false ? substr($uri, 0, $amp) : $uri;
     $parts = explode('/', $uri);
     $controller = array_shift($parts);
     $controller = $controller ? $controller : DEFAULT_CONTROLLER;
     $controller = ucwords($controller);
     $method = array_shift($parts);
     $method = $method ? $method : DEFAULT_METHOD;
     $args = !empty($parts) ? $parts : array();
     // Check for file
     if (!file_exists("app/Controllers/{$controller}.php")) {
         return false;
     }
     $controller = "\\Controllers\\{$controller}";
     $c = new $controller();
     if (method_exists($c, $method)) {
         $c->{$method}($args);
         //found method so stop
         return true;
     }
     return false;
 }
开发者ID:hieunguyenbk,项目名称:AgriExtension,代码行数:29,代码来源:Router.php

示例12: hist_exam_plan_report

function hist_exam_plan_report($pid, $encounter, $cols, $id)
{
    $cols = 1;
    // force always 1 column
    $count = 0;
    $data = sqlQuery("SELECT * " . "FROM form_hist_exam_plan WHERE " . "id = '{$id}' AND activity = '1'");
    if ($data) {
        print "<table cellpadding='0' cellspacing='0'>\n<tr>\n";
        foreach ($data as $key => $value) {
            if ($key == "id" || $key == "pid" || $key == "user" || $key == "groupname" || $key == "authorized" || $key == "activity" || $key == "date" || $value == "" || $value == "0" || $value == "0.00") {
                continue;
            }
            if ($value == "on") {
                $value = "yes";
            }
            $key = ucwords(str_replace("_", " ", $key));
            print "<td valign='top'><span class='bold'>{$key}: </span><span class='text'>{$value} &nbsp;</span></td>\n";
            $count++;
            if ($count == $cols) {
                $count = 0;
                print "</tr>\n<tr>\n";
            }
        }
        print "</tr>\n</table>\n";
    }
}
开发者ID:katopenzz,项目名称:openemr,代码行数:26,代码来源:report.php

示例13: run

 public function run(&$_data)
 {
     $engine = strtolower(C('TMPL_ENGINE_TYPE'));
     if ('think' == $engine) {
         //[sae] 采用Think模板引擎
         if ($this->checkCache($_data['file'])) {
             // 缓存有效
             SaeMC::include_file(md5($_data['file']) . C('TMPL_CACHFILE_SUFFIX'), $_data['var']);
         } else {
             $tpl = Think::instance('ThinkTemplate');
             // 编译并加载模板文件
             $tpl->fetch($_data['file'], $_data['var']);
         }
     } else {
         // 调用第三方模板引擎解析和输出
         $class = 'Template' . ucwords($engine);
         if (is_file(CORE_PATH . 'Driver/Template/' . $class . '.class.php')) {
             // 内置驱动
             $path = CORE_PATH;
         } else {
             // 扩展驱动
             $path = EXTEND_PATH;
         }
         if (require_cache($path . 'Driver/Template/' . $class . '.class.php')) {
             $tpl = new $class();
             $tpl->fetch($_data['file'], $_data['var']);
         } else {
             // 类没有定义
             throw_exception(L('_NOT_SUPPERT_') . ': ' . $class);
         }
     }
     //[sae] 添加trace信息。
     trace(array('[SAE]核心缓存' => $_SERVER['HTTP_APPVERSION'] . '/' . RUNTIME_FILE, '[SAE]模板缓存' => $_SERVER['HTTP_APPVERSION'] . '/' . md5($_data['file']) . C('TMPL_CACHFILE_SUFFIX')));
 }
开发者ID:nexteee,项目名称:php,代码行数:34,代码来源:ParseTemplateBehavior.class.php

示例14: factory

 public static function factory($options)
 {
     $options = is_array($options) ? $options : array();
     //只实例化一个对象
     if (is_null(self::$cacheFactory)) {
         self::$cacheFactory = new cacheFactory();
     }
     $driver = isset($options['driver']) ? $options['driver'] : C("CACHE_TYPE");
     //静态缓存实例名称
     $driverName = md5_s($options);
     //对象实例存在
     if (isset(self::$cacheFactory->cacheList[$driverName])) {
         return self::$cacheFactory->cacheList[$driverName];
     }
     $class = 'Cache' . ucwords(strtolower($driver));
     //缓存驱动
     $classFile = YY_PATH . 'Cache/' . $class . '.class.php';
     //加载驱动类库文件
     if (!require_array($classFile)) {
         halt("缓存类型指定错误,不存在缓存驱动文件:" . $classFile);
     }
     $cacheObj = new $class($options);
     self::$cacheFactory->cacheList[$driverName] = $cacheObj;
     return self::$cacheFactory->cacheList[$driverName];
 }
开发者ID:kumfo,项目名称:YYphp,代码行数:25,代码来源:CacheFactory.class.php

示例15: display_each_ebook

function display_each_ebook($directory, $name)
{
    $check_thumb = check_thumb_exists(urldecode($directory . $name));
    echo '<td id = "thumbnail_container" width = "14%">
			<img rel ="images" id = "' . $directory . $name . '" src = "' . \OCP\Util::linkTo('reader', 'ajax/thumbnail.php') . '&filepath=' . $directory . rtrim($name, 'pdf') . 'png' . '">	
		</td>';
    echo '<td class = "filename svg" width = "86%">
			<a class="name" href="http://localhost' . \OCP\Util::linkTo('files', 'download.php') . '?file=' . $directory . $name . '" title="' . urldecode($name) . '" dir ="' . $directory . $name . '" value  = "' . $check_thumb . '">
				<span class = "nametext">' . htmlspecialchars(urldecode($name)) . '</span>
			</a>
			<div id = "displaybox">';
    $each_row = find_tags_for_ebook(urldecode($directory) . urldecode($name));
    $tags = explode(",", $each_row);
    $tag_count = 1;
    foreach ($tags as $tag) {
        if ($tag_count == 2) {
            echo ", ";
        }
        echo '<a href = "' . \OCP\Util::linkTo('reader', 'fetch_tags.php') . '?tag=' . $tag . '">' . ucwords($tag) . '</a>';
        $tag_count += 1;
    }
    echo '</div>
			<input type="button" class="start" value="Add Tag">
			<div id="contentbox" contenteditable="true"></div>
		</td>';
}
开发者ID:nanowish,项目名称:apps,代码行数:26,代码来源:library_display.php


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