本文整理汇总了PHP中Str::upper方法的典型用法代码示例。如果您正苦于以下问题:PHP Str::upper方法的具体用法?PHP Str::upper怎么用?PHP Str::upper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Str
的用法示例。
在下文中一共展示了Str::upper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: post_new
public function post_new()
{
$input = Input::all();
//grab our input
$rules = array('name' => 'required|alpha', 'lastName' => 'required|alpha', 'permit' => 'required|min:2', 'lot' => 'required|integer', 'msc' => 'integer', 'ticket' => 'required|min:2|numeric|unique:tickets,ticketID', 'fineAmt' => 'required|numeric', 'licensePlate' => 'required|alpha_num', 'licensePlateState' => 'required|max:2', 'dateIssued' => 'required', 'violations' => 'required', 'areaOfViolation' => 'required|alpha_num', 'appealLetter' => 'required|max:700');
//validation rules
$validation = Validator::make($input, $rules);
//let's run the validator
if ($validation->fails()) {
return Redirect::to('appeal/new')->with_errors($validation);
}
//hashing the name of the file uploaded for security sake
//then we'll be dropping it into the public/uploads file
//get the file extension
$extension = File::extension($input['appealLetter']['name']);
//encrypt the file name
$file = Crypter::encrypt($input['appealLetter']['name'] . time());
//for when the crypter likes to put slashes in our scrambled filname
$file = preg_replace('#/+#', '', $file);
//concatenate extension and filename
$filename = $file . "." . $extension;
Input::upload('appealLetter', path('public') . 'uploads/', $filename);
//format the fine amount in case someone screws it up
$fineamt = number_format(Input::get('fineAmt'), 2, '.', '');
//inserts the form data into the database assuming we pass validation
Appeal::create(array('name' => Input::get('name'), 'lastName' => Input::get('lastName'), 'permitNumber' => Input::get('permit'), 'assignedLot' => Input::get('lot'), 'MSC' => Input::get('msc'), 'ticketID' => Input::get('ticket'), 'fineAmt' => $fineamt, 'licensePlate' => Str::upper(Input::get('licensePlate')), 'licensePlateState' => Input::get('licensePlateState'), 'dateIssued' => date('Y-m-d', strtotime(Input::get('dateIssued'))), 'violations' => Input::get('violations'), 'areaOfViolation' => Input::get('areaOfViolation'), 'letterlocation' => URL::to('uploads/' . $filename), 'CWID' => Session::get('cwid')));
return Redirect::to('appeal/')->with('alertMessage', 'Appeal submitted successfully.');
}
示例2: get_credentials
/**
* Return the credentials for the call.
*
* @return mixed The array of credentials or an empty array if we couldn't find them, or false if the supplied
* credentials were in an invalid format
*/
public static function get_credentials()
{
if (\V1\APIRequest::is_static()) {
return static::decode_credentials(\V1\Model\APIs::get_api());
} else {
$account_data = \V1\Model\Account::get_account();
/**
* Check for stored credentials
*/
$formatted_credentials = static::decode_credentials($account_data);
/**
* Credentials provided through the request
*/
if (is_array($posted_credentials = \V1\APIRequest::get('auth', false)) && !empty($posted_credentials)) {
foreach ($posted_credentials as $variable => $value) {
// Bad format
if (!is_string($value)) {
return false;
}
$formatted_credentials[\Str::upper($variable)] = $value;
}
// Do they want the credentials stored in the DB?
if ($account_data['store_credentials'] === 1) {
// Store their credentials encrypted.
$credentials[\V1\APIRequest::get('api')] = $formatted_credentials;
$existing_credentials = static::decode_credentials($account_data);
$credentials = array_replace_recursive($existing_credentials, $credentials);
$credentials_encrypted = \Crypt::encode(json_encode($credentials));
\V1\Model\AccountsMetaData::set_credentials($account_data['id'], $credentials_encrypted);
}
}
return $formatted_credentials;
}
}
示例3: getItemAttribute
public function getItemAttribute()
{
if (empty($this->item_type)) {
return null;
}
// todo fix this to be right
$model = '\\' . \Str::upper($this->item_type);
return $model::find($this->item_id);
}
示例4: applyclaims
public static function applyclaims($input)
{
$user = new Claims_App();
$refno = 'MC' . Str::upper(Str::random(4, 'alpha')) . time();
try {
$id = $user->insert_get_id(array('claimscat' => $input['claimscat'], 'flowid' => $input['claimscat'], 'claimsref' => $refno, 'status' => Flow::next(), 'userid' => Auth::user()->userid, 'created_at' => date("Y-m-d H:i:s"), 'updated_at' => date("Y-m-d H:i:s"), 'applymonth' => $input['applymonth']));
Log::write('Claims', 'Claims Application ' . $refno . ' successfully created');
return $id;
} catch (Exception $e) {
Log::write('Claims', 'Claims Application not success');
}
}
示例5: breadcrumb
/**
* breadcrumb function
* Create breadcrumb
* @return string
* @author joharijumali
**/
public static function breadcrumb()
{
$Menu = Admin_Menu::menuGenerator();
$butternbread = array();
foreach ($Menu as $floor => $packet) {
foreach ($packet->page->action as $key => $action) {
if ($packet->packet == Str::lower(URI::segment(1)) && $packet->controller->name == Str::lower(URI::segment(2)) && $action->name == Str::lower(URI::segment(3)) || URI::segment(3) == NULL && $action->name == $packet->controller->name && Str::lower(URI::segment(2)) == $packet->controller->name) {
$butternbread[Str::upper($packet->controller->alias)] = '#';
array_push($butternbread, Str::title($action->alias));
}
}
}
return Breadcrumb::create($butternbread);
}
示例6: post_datagroup
public function post_datagroup()
{
$input = Input::get();
$existed = Group::checkTable($input['group_model'], $input['group_key']);
if ($existed) {
if ($input['groupid'] == NULL) {
$dataGroup = new Group();
} else {
$dataGroup = Group::find($input['groupid']);
}
$dataGroup->group_name = Str::upper($input['group_name']);
$dataGroup->group_model = $input['group_model'];
$dataGroup->group_key = $input['group_key'];
$dataGroup->save();
return json_encode(Group::listData());
} else {
return json_encode(array('fail' => Str::title(Lang::line('admin.groupfail')->get())));
}
}
示例7: write
/**
* Write a message to the log file.
*
* <code>
* // Write an "error" message to the log file
* Log::write('error', 'Something went horribly wrong!');
*
* // Log an arrays data
* Log::write('info', array('name' => 'Sawny', 'passwd' => '1234', array(1337, 21, 0)));
* //Result: Array ( [name] => Sawny [passwd] => 1234 [0] => Array ( [0] => 1337 [1] => 21 [2] => 0 ) )
* </code>
*
* @param string $type
* @param string $message
* @return void
*/
public static function write($type, $message)
{
if (is_array($message) || is_object($message)) {
$message = print_r($message, true);
}
$trace = debug_backtrace();
foreach ($trace as $item) {
if (isset($item["class"]) and $item["class"] == __CLASS__) {
continue;
}
$caller = $item;
break;
}
$function = $caller["function"];
if (isset($caller["class"])) {
$class = $caller["class"] . "::";
} else {
$class = "";
}
File::mkdir(J_APPPATH . "storage" . DS . "logs" . DS);
File::append(J_APPPATH . "storage" . DS . "logs" . DS . date("Y-m-d") . ".log", date("Y-m-d H:i:s") . " " . Str::upper($type) . " - " . $class . $function . " - " . $message . CRLF);
}
示例8: __construct
public function __construct($name, $label, $path)
{
parent::__construct($name, $label);
$this->type = "upload";
$id = uniqueID();
$this->sessionKey = "manager_" . $this->type . $id;
$this->updateURL = "fields/" . $this->type . $id;
$this->limit = 1;
$this->hasCaption = false;
$this->path = $path;
$this->defaultValue = array();
$this->accepts = array();
$this->acceptsMask = null;
$that = $this;
Router::register("POST", "manager/api/" . $this->updateURL . "/(:segment)/(:num)/(:segment)", function ($action, $id, $flag) use($that) {
if (($token = User::validateToken()) !== true) {
return $token;
}
$flag = Str::upper($flag);
$that->module->flag = $flag;
switch ($action) {
default:
case "update":
return Response::json($that->upload($flag, $id));
break;
case "sort":
return Response::json($that->sort(Request::post("from", -1), Request::post("to", -1)));
break;
case "caption":
return Response::json($that->setCaption((int) Request::post("index", -1), Request::post("caption")));
break;
case "delete":
return Response::json($that->delete((int) Request::post("index", -1)));
break;
}
return Response::code(500);
});
}
示例9: render
public static function render()
{
$rolelist = Admin_UserRole::all();
$page = Acltree::datasource();
//all();
$acl = Admin_UserAcl::aclRegistered();
$content = array();
$fot = 1;
foreach ($rolelist as $role) {
$subcontent = '<h3>' . Str::upper($role->role . " Setup") . '</h3>';
$subcontent .= '<ul class="nav nav-list">';
foreach ($page as $controller => $selection) {
$subcontent .= '<li class="nav-header"><i class="icon-hdd"></i> ' . Str::upper($selection['alias']) . '</li>';
$subcontent .= '<div class="row-fluid">';
foreach ($selection['page'] as $action => $alias) {
$subcontent .= '<span style="padding-right:5px;width:auto;">';
$subcontent .= Form::hidden($role->role . '[id]', $role->roleid);
if (in_array($role->roleid, array_keys($acl)) && in_array($controller, array_keys($acl[$role->roleid])) && in_array($action, array_keys($acl[$role->roleid][$controller])) && $acl[$role->roleid][$controller][$action] == true) {
$subcontent .= Form::inline_labelled_checkbox($role->role . '[' . $controller . '][' . $action . ']', Str::title($alias), null, array('checked' => true, 'style' => 'padding:2px'));
} else {
$subcontent .= Form::inline_labelled_checkbox($role->role . '[' . $controller . '][' . $action . ']', $alias);
}
$subcontent .= '</span>';
}
$subcontent .= '</div >';
$subcontent .= '<li class="divider"></li>';
}
$subcontent .= '</ul>';
$active = $fot == 1 ? true : false;
$fot++;
array_push($content, array(Str::upper($role->role), $subcontent, $active));
}
$nav = Navigation::links($content);
$tab = Tabbable::tabs_left($nav);
return $tab;
}
示例10: run
/**
* Run the request
*
* @param \Raml\SecurityScheme $securityscheme_obj The security scheme to process the call data for
* @param \V1\APICall $apicall_obj The APICall object
*
* @return mixed The object we just completed or an array describing the next step in the security process
*/
public function run(\Raml\SecurityScheme $securityscheme_obj, \V1\APICall $apicall_obj)
{
$settings = $securityscheme_obj->getSettings();
$credentials = $apicall_obj->get_credentials();
// Save the credentials
\V1\Keyring::set_credentials($credentials);
/**
* By default we'll return the response from the authentication request so that it's meaningful.
* However, in doing so, we'll need to block the main request, so developers may set this flag
* to ignore the authentication, signifying that they've already got the information they needed
* from it.
*
* NOTE: This security method is meant as a basic way to catch security methods we otherwise
* haven't implemented in our system. Take it for what it's worth.
*
* @TODO When using this security method, skip processing the APICall object for a speedup.
*/
if (!empty($credentials['CUSTOM_IGNORE_AUTH'])) {
return true;
}
// Remove unused credentials so as not to replace bad variables in the template.
foreach ($credentials as $variable => $entry) {
if (strpos($variable, 'CUSTOM_') !== 0) {
unset($credentials[$variable]);
}
}
// We need the method or we'll fail the call.
if (empty($settings['method'])) {
$this->error = true;
return $this;
}
// Normalize the data into arrays.
$described_by = $securityscheme_obj->getDescribedBy();
$headers = $this->get_param_array($described_by->getHeaders());
$query_params = $this->get_param_array($described_by->getQueryParameters());
$bodies = $described_by->getBodies();
$method = \Str::upper($settings['method']);
$url = $settings['url'];
// Grab the body if we have one, and the method supports one.
$body = null;
$body_type = null;
if (count($bodies) > 0 && !in_array($method, array('GET', 'HEAD'))) {
reset($bodies);
$body_type = key($bodies);
$body = $bodies[$body_type]->getExamples()[0];
}
/**
* NOTE: These replacements may ruin the formatting or allow for people to inject data into them.
* API Providers should be aware of that possibility.
*
* @TODO In the future, we can consider implementing checking to verify that people aren't sending
* crap data through the system.
*/
$headers = $this->remove_cr_and_lf($this->replace_variables($headers, $credentials));
$query_params = $this->remove_cr_and_lf($this->replace_variables($query_params, $credentials));
$body = $this->replace_variables($body, $credentials);
if (!empty($query_params)) {
$query_string = http_build_query($query_params, null, '&');
if (strpos($url, '?') === false) {
$url .= '?' . $query_string;
} else {
$url .= '&' . $query_string;
}
}
/**
* RUNCLE RICK'S RAD RUN CALLS (The second coming!)
*/
$curl = \Remote::forge($url, 'curl', $method);
// Set the headers
$headers = \V1\RunCall::get_headers($headers);
foreach ($headers as $header_name => $header_value) {
$curl->set_header($header_name, $header_value);
}
// Return the headers
$curl->set_option(CURLOPT_HEADER, true);
// If we need a body, set that.
if (!empty($body) && !in_array($method, array('GET', 'HEAD'))) {
$curl->set_header('Content-Type', $body_type);
$curl->set_params($body);
}
// Run the request
try {
$response = $curl->execute()->response();
} catch (\RequestStatusException $e) {
$response = \Remote::get_response($curl);
} catch (\RequestException $e) {
$this->error = true;
return $this;
}
// Set the usage stats, and format the response
return \V1\Socket::prepare_response(array('status' => $response->status, 'headers' => $response->headers, 'body' => $response->body));
}
示例11: generate
public static function generate()
{
$admin = Arcone::getadministrator();
$totalStruct = $struct = Arcone::getstructures();
$structModeling = Admin_ModulPage::getRegPages();
$totalStruct = Arcone::getallstructures();
$view = '<ul class="nav nav-list">';
foreach ($totalStruct as $modul => $content) {
if (!empty($structModeling[$modul])) {
$view .= '<li class="nav-header alert alert-info"><i class="icon-hdd"></i> ' . Str::upper($modul) . '</li>';
$view .= Form::hidden($modul . '[id]');
$registered = !empty($structModeling[$modul]) ? 'alert alert-success' : 'alert';
$view .= '<li class="' . $registered . '">';
$idiv = count($content);
foreach ($content as $submodul => $subcontent) {
if (isset($structModeling[$modul][$submodul])) {
$view .= '<ul class="nav nav-list">';
$view .= '<li style="height:30px" ><i class="icon-folder-close"></i> ' . Str::title($submodul);
$submodulID = isset($structModeling[$modul][$submodul]) ? $structModeling[$modul][$submodul]['modulpageid'] : null;
$view .= Form::hidden($modul . '[' . $submodul . '][id]', $submodulID);
// $view .= '<div class="span6 form-inline pull-right" >';
// $submodulArrg = isset($structModeling[$modul][$submodul])?$structModeling[$modul][$submodul]['arrangement']:null;
// $view .= Form::mini_text($modul.'['.$submodul.'][arrangement]', $submodulArrg , array('class' => 'input-small',
// 'style'=>'height:10px;width:10px;box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);background:none repeat scroll 0 0 rgba(0, 0, 0, 0.2);color:#fff','placeholder' => '#'));
// $submodulAlias = isset($structModeling[$modul][$submodul])? $structModeling[$modul][$submodul]['controlleralias']:'';
// $view .= Form::mini_text($modul.'['.$submodul.'][controlleralias]', $submodulAlias, array('class' => 'input-small','style'=>'height:10px;font-size:12px;','placeholder' => 'Alias'));
// $view .= ' ';
// $submodulVisible = isset($structModeling[$modul][$submodul])? $structModeling[$modul][$submodul]['visible']:0;
// $submodulVisibleChecked = ($submodulVisible == 1)? array('checked') : array();
// $view .= Form::labelled_checkbox($modul.'['.$submodul.'][show]', '<em><small>Show</small></em>',null,$submodulVisibleChecked);
// $view .= ' ';
// $submodulAuth = isset($structModeling[$modul][$submodul])? $structModeling[$modul][$submodul]['auth']:0;
// $submodulAuthChecked = ($submodulAuth == 1)? array('checked') : array();
// $view .= Form::labelled_checkbox($modul.'['.$submodul.'][auth]', '<em><small>Auth</small></em>',null,$submodulAuthChecked);
// $view .= ' ';
// $submodulAdmin = isset($structModeling[$modul][$submodul]['admin'])? $structModeling[$modul][$submodul]['admin']:0;
// $submodulAdminChecked = ($submodulAdmin == 1)? array('checked') : array();
// $view .= Form::labelled_checkbox($modul.'['.$submodul.'][admin]', '<em><small>Admin Only</small></em>',null,$submodulAdminChecked);
// $view .= ' ';
// $view .= '</div>';
$view .= '</li>';
$arrayBal = array();
$view .= '<li ><ul class="nav nav-list">';
foreach ($subcontent as $action) {
$registered = !isset($structModeling[$modul][$submodul][$action]) ? 'class ="alert" style="border:none;background-color:transparent;padding:0px;height:30px;margin-bottom:0px;" ' : 'style="height:30px" ';
$view .= '<li ' . $registered . '>';
$view .= '<i class="icon-list-alt "></i> ' . Str::title($action) . ' <em><small>' . Str::title($modul . '/' . $submodul . '/' . $action) . '</small></em>';
$actionID = isset($structModeling[$modul][$submodul][$action]) ? $structModeling[$modul][$submodul][$action]['modulpageid'] : null;
$view .= Form::hidden($modul . '[' . $submodul . '][' . $action . '][id]', $actionID);
$view .= '<div class="span6 form-inline pull-right" >';
$actionArrg = isset($structModeling[$modul][$submodul][$action]) ? $structModeling[$modul][$submodul][$action]['arrangement'] : null;
$view .= Form::mini_text($modul . '[' . $submodul . '][' . $action . '][arrangement]', $actionArrg, array('class' => 'input-small', 'style' => 'height:10px;width:10px', 'placeholder' => '#'));
$actionAlias = isset($structModeling[$modul][$submodul][$action]) ? $structModeling[$modul][$submodul][$action]['actionalias'] : '';
$view .= Form::mini_text($modul . '[' . $submodul . '][' . $action . '][actionalias]', $actionAlias, array('class' => 'input-small', 'style' => 'height:10px;font-size:12px;', 'placeholder' => 'Alias'));
$view .= ' ';
$actionVisible = isset($structModeling[$modul][$submodul][$action]) ? $structModeling[$modul][$submodul][$action]['visible'] : 0;
$actionVisibleChecked = $actionVisible == 1 ? array('checked') : array();
$view .= Form::labelled_checkbox($modul . '[' . $submodul . '][' . $action . '][show]', '<em><small>Show</small></em>', null, $actionVisibleChecked);
$view .= ' ';
$actionAuth = isset($structModeling[$modul][$submodul][$action]) ? $structModeling[$modul][$submodul][$action]['auth'] : 0;
$actionAuthChecked = $actionAuth == 1 ? array('checked') : array();
$view .= Form::labelled_checkbox($modul . '[' . $submodul . '][' . $action . '][auth]', '<em><small>Auth</small></em>', null, $actionAuthChecked);
$view .= ' ';
$actionAdmin = isset($structModeling[$modul][$submodul][$action]) ? $structModeling[$modul][$submodul][$action]['admin'] : 0;
$actionAdminChecked = $actionAdmin == 1 ? array('checked') : array();
$view .= Form::labelled_checkbox($modul . '[' . $submodul . '][' . $action . '][admin]', '<em><small>Admin Only</small></em>', null, $actionAdminChecked);
$view .= ' ';
$view .= '</div>';
$view .= '</li>';
unset($structModeling[$modul][$submodul][$action]);
}
$view .= '</ul></li>';
$idiv--;
if ($idiv != 0) {
$view .= '<li class="divider"></li>';
}
unset($structModeling[$modul][$submodul]['modulpageid']);
unset($structModeling[$modul][$submodul]['arrangement']);
unset($structModeling[$modul][$submodul]['controlleralias']);
unset($structModeling[$modul][$submodul]['visible']);
unset($structModeling[$modul][$submodul]['auth']);
unset($structModeling[$modul][$submodul]['admin']);
unset($structModeling[$modul][$submodul]['header']);
unset($structModeling[$modul][$submodul]['footer']);
if (!empty($structModeling[$modul][$submodul])) {
$view .= '<li class="alert-error">';
foreach ($structModeling[$modul][$submodul] as $deletedaction => $deletedcontent) {
$view .= '<ul class="nav nav-list">';
$view .= '<li>';
$view .= '<i class="icon-remove"></i> ' . Str::title($deletedcontent['actionalias']) . ' <em>' . $modul . '/' . $submodul . '/' . $deletedaction . '</em>';
$view .= Form::hidden($modul . '[' . $submodul . '][' . $deletedaction . '][id]', $deletedcontent['modulpageid']);
$view .= '<div class="span6 form-inline pull-right" >';
$view .= Form::labelled_checkbox($modul . '[' . $submodul . '][' . $deletedaction . '][remove]', '<em><small>Remove</small></em>');
$view .= '</div>';
$view .= '</li>';
$view .= '</ul >';
unset($structModeling[$modul][$submodul][$deletedaction]);
}
$view .= '</li>';
}
//.........这里部分代码省略.........
示例12: format
/**
* Format a log message for logging.
*
* @param string $type
* @param string $message
* @return string
*/
protected static function format($type, $message)
{
return date('Y-m-d H:i:s') . ' ' . Str::upper($type) . " - {$message}" . PHP_EOL;
}
示例13: execDBFunc
private function execDBFunc($func, $name)
{
$alias = Str::lower($func);
$func = Str::upper($func);
if ($name != "*") {
$name = $this->quoteField($name);
}
$this->selectRaw($func . "(" . $name . ")", $alias);
$orm = $this->findFirst();
$result = 0;
if ($orm) {
$result = $orm->{$alias};
}
array_pop($this->selectFields);
if (count($this->selectFields) == 0) {
$this->selectFields = "*";
}
if ((int) $result == (double) $result) {
return (int) $result;
} else {
return (double) $result;
}
}
示例14: write
/**
* Write a message to the log file.
*
* <code>
* // Write an "error" messge to the log file
* Log::write('error', 'Something went horribly wrong!');
*
* // Write an "error" message using the class' magic method
* Log::error('Something went horribly wrong!');
* </code>
*
* @param string $type
* @param string $message
* @return void
*/
public static function write($type, $message)
{
$message = date('Y-m-d H:i:s') . ' ' . Str::upper($type) . " - {$message}" . PHP_EOL;
File::append(path('storage') . 'logs/' . date('Y-m-d') . '.log', $message);
}
示例15: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//Get book name from session
$title = Session::get('book_title');
//Set variables
$data['issue_id'] = $id;
$book_id = Comicbooks::series($title)->select('comicdb_books.id')->first();
$book_issue = Comicissues::issues($title, $id)->select('book_id', 'issue_id')->first();
//If book issue exists, then get data for it
if (!is_null($book_issue)) {
$data['book_title'] = '<em>' . Str::upper($title) . '</em>';
$data['book_id'] = Comicbooks::series($title)->select('comicdb_books.id')->first();
$data['book_info'] = Comicissues::issues($title, $id)->select('issue_id', 'summary', 'published_date', 'cover_image', 'artist_name', 'author_name')->distinct()->get();
$this->layout->content = View::make('editissues', $data);
} else {
return Redirect::to('browse')->with('postMsg', 'Looks like that issue does not exist! Please check out any other titles here.');
}
}