• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Laravel\Str类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sidebar

 /**
  * sidebar function
  * Create sidebar
  * @return string
  * @author joharijumali
  **/
 public static function sidebar()
 {
     // $Menu = Header::navigationdata();
     $flow = URI::segment(3) == 'step' ? true : false;
     $navValue = array(array(Navigation::HEADER, Str::upper(Lang::line('admin.monitor')->get())), array(Lang::line('admin.dashboard')->get(), url('admin/home/dashboard'), false, false, null, 'tasks'), array(Navigation::HEADER, Str::upper(Lang::line('admin.sysmgmt')->get())), array(Lang::line('admin.configmanagement')->get(), url('admin/system/sysConfig'), false, false, null, 'chevron-right'), array(Lang::line('admin.datamanagement')->get(), url('admin/data/board'), false, false, null, 'chevron-right'), array(Lang::line('admin.pagemanagement')->get(), url('admin/modul/page'), false, false, null, 'chevron-right'), array(Lang::line('admin.flowmanagement')->get(), url('admin/modul/flow'), $flow, false, null, 'chevron-right'), array(Lang::line('admin.navsetup')->get(), url('admin/system/navigate'), false, false, null, 'chevron-right'), array(Lang::line('admin.log')->get(), url('admin/system/logger'), false, false, null, 'chevron-right'), array(Navigation::HEADER, Str::upper(Lang::line('admin.sysuser')->get())), array(Lang::line('admin.navuserlist')->get(), url('admin/user/list'), false, false, null, 'chevron-right'), array(Lang::line('admin.navuserrole')->get(), url('admin/user/role'), false, false, null, 'chevron-right'), array(Navigation::HEADER, Lang::line('global.logout')->get()), array(Lang::line('global.logout')->get(), url('admin/login/logout'), false, false, null, 'off'));
     return Navigation::lists(Navigation::links($navValue));
 }
开发者ID:farhan4648gul,项目名称:developer-side,代码行数:13,代码来源:navigator.php


示例2: opinionated

 /**
  * Register opinionated controllers
  * 
  * @param array		$controllers	the controllers and config
  * @param string	$bundle			the bundle where the controller can be found
  * @param string	$url_prefix		a global url prefix
  * @param string	$route_type		the type of the route (pages or api)
  * @param array		$parents
  */
 public static function opinionated($controllers, $bundle, $url_prefix, $route_type, $parents = array())
 {
     if (!ends_with($url_prefix, '/')) {
         $url_prefix .= '/';
     }
     foreach ($controllers as $controller => $options) {
         list($types, $children) = $options;
         foreach ($types as $type) {
             list($method, $plural, $has_identity, $postfix) = static::$types[$type];
             $segment = $controller;
             $action = ($bundle ? $bundle . '::' : '') . implode('.', $parents) . (count($parents) > 0 ? '.' : '') . $segment . '@' . $type;
             if ($plural) {
                 $segment = Str::plural($segment);
             }
             $prefixes = array_map(function ($parent) {
                 return $parent ? $parent . '/(:any)/' : '(:any)/';
             }, $parents);
             $prefix = implode('', $prefixes);
             $route = $url_prefix . $prefix . $segment . ($has_identity ? '/(:any)' : '') . ($route_type == 'pages' && $postfix ? '/' . $postfix : '');
             if ($route_type == 'pages') {
                 $method = '*';
             }
             Router::register($method, $route, $action);
         }
         $parents[] = $controller;
         if (is_array($children)) {
             static::opinionated($children, $bundle, $url_prefix, $route_type, $parents);
         }
         $parents = array();
     }
 }
开发者ID:reith2004,项目名称:components,代码行数:40,代码来源:route.php


示例3: getModel

 public static function getModel($model)
 {
     $models = static::getModels();
     if (!in_array($model, $models)) {
         return false;
     }
     $model = Str::singular($model);
     return $model;
 }
开发者ID:ashicus,项目名称:apocalypse,代码行数:9,代码来源:helpers.php


示例4: runMigration

 protected function runMigration($version, $migration, $method)
 {
     $file = $this->path() . $version . DS . $migration . '.php';
     $this->log('Migrate ' . $migration . '...');
     $class = 'FluxBB_Update_' . Str::classify($migration);
     include_once $file;
     $instance = new $class();
     $instance->{$method}();
 }
开发者ID:imihael,项目名称:fluxbb-core,代码行数:9,代码来源:Update.php


示例5: setData

 public static function setData($input)
 {
     $Category = $input['id'] == NULL || !isset($input['id']) ? new Status() : Status::find($input['id']);
     $Category->status_name = Str::title($input['data']);
     $Category->status_desc = $input['description'];
     $Category->save();
     $action = $input['id'] == NULL || !isset($input['id']) ? 'Insert' : '<b>(' . $input['id'] . ')</b> Update';
     Log::write('Data', 'Status <b>' . $input['data'] . '</b> ' . $action . ' by ' . Auth::user()->username);
 }
开发者ID:farhan4648gul,项目名称:developer-side,代码行数:9,代码来源:Status.php


示例6: stub

 /**
  * Get the stub migration with the proper class name.
  *
  * @param  string  $bundle
  * @param  string  $migration
  * @return string
  */
 protected function stub($bundle, $migration)
 {
     $stub = File::get(Bundle::path('doctrine') . 'migration_stub' . EXT);
     $prefix = Bundle::class_prefix($bundle);
     // The class name is formatted simialrly to tasks and controllers,
     // where the bundle name is prefixed to the class if it is not in
     // the default "application" bundle.
     $class = $prefix . Str::classify($migration);
     return str_replace('{{class}}', $class, $stub);
 }
开发者ID:SerdarSanri,项目名称:doctrine-bundle,代码行数:17,代码来源:migrate.php


示例7: id

 /**
  * Get a new session ID that isn't assigned to any current session.
  *
  * @return string
  */
 public function id()
 {
     $session = array();
     // We'll containue generating random IDs until we find an ID that is
     // not currently assigned to a session. This is almost definitely
     // going to happen on the first iteration.
     do {
         $session = $this->load($id = Str::random(40));
     } while (!is_null($session));
     return $id;
 }
开发者ID:victoroliveira1605,项目名称:Laravel-Bootstrap,代码行数:16,代码来源:driver.php


示例8: listData

 public static function listData()
 {
     $allGroup = Group::paginate(Config::get('system.pagination'));
     $datagrid = new Datagrid();
     $datagrid->setFields(array('group_name' => Str::upper(Lang::line('admin.datagroup')->get())));
     $datagrid->setAction(Lang::line('global.manage')->get(), 'datacontent', false);
     $datagrid->setAction(Lang::line('global.edit')->get(), 'editGroup', true, array('dmid'));
     $datagrid->setAction(Lang::line('global.delete')->get(), 'deleteGroup', true, array('dmid', 'group_name'));
     $datagrid->setTable('dataGroup', 'table table-bordered table-hover table-striped table-condensed');
     $datagrid->build($allGroup, 'dmid');
     return $datagrid->render();
 }
开发者ID:farhan4648gul,项目名称:developer-side,代码行数:12,代码来源:Group.php


示例9: listRole

 public static function listRole()
 {
     $rolelist = Role::paginate(Config::get('system.pagination'));
     $datagrid = new Datagrid();
     $datagrid->setFields(array('role' => Str::upper(Lang::line('admin.rolename')->get()), 'roledesc' => Str::upper(Lang::line('admin.roledesc')->get())));
     $datagrid->setAction(Lang::line('global.edit')->get(), 'editRoleModal', true, array('roleid'));
     //false,array('id'=>'roleid','data-toggle'=>'modal'));
     $datagrid->setAction(Lang::line('global.delete')->get(), 'deleteRole', true, array('roleid'));
     $datagrid->setContainer('list01', 'span12');
     $datagrid->setTable('users', 'table table-bordered table-hover table-striped table-condensed');
     $datagrid->build($rolelist, 'roleid');
     return $datagrid->render();
 }
开发者ID:farhan4648gul,项目名称:developer-side,代码行数:13,代码来源:Role.php


示例10: generate

 /**
  * Generate a random key for the application.
  *
  * @param  array  $arguments
  * @return void
  */
 public function generate($arguments = array())
 {
     // By default the Crypter class uses AES-256 encryption which uses
     // a 32 byte input vector, so that is the length of string we will
     // generate for the application token unless another length is
     // specified through the CLI.
     $key = Str::random(array_get($arguments, 0, 32));
     $config = File::get($this->path);
     $config = str_replace("'key' => '',", "'key' => '{$key}',", $config, $count);
     File::put($this->path, $config);
     if ($count > 0) {
         echo "Configuration updated with secure key!";
     } else {
         echo "An application key already exists!";
     }
     echo PHP_EOL;
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:23,代码来源:key.php


示例11: get_edit

 public function get_edit($model = null, $id = null)
 {
     $name = $model;
     if (is_null($model) || is_null($id)) {
         return Redirect::to(Adminify\Libraries\Helpers::url('/'));
     }
     $model = Helpers::getModel($model);
     if (is_null($model)) {
         return Redirect::to(Adminify\Libraries\Helpers::url('/'));
     }
     $entry = $model::find($id);
     $table = property_exists($model, 'table') && !is_null($model::$table) ? $model::$table : strtolower(Str::plural($model));
     $structure = DB::query("SHOW COLUMNS FROM `" . $table . "`");
     $excluded = Helpers::getFields($model);
     $this->layout->title = 'Edit ' . $model;
     $this->layout->nest('content', 'adminify::models.edit', array('entry' => $entry, 'model' => $model, 'name' => $name, 'structure' => $structure, 'excluded' => $excluded));
 }
开发者ID:ashicus,项目名称:apocalypse,代码行数:17,代码来源:models.php


示例12: id

 /**
  * Get a new session ID that isn't assigned to any current session.
  *
  * @return string
  */
 public function id()
 {
     $session = array();
     // If the driver is an instance of the Cookie driver, we are able to
     // just return any string since the Cookie driver has no real idea
     // of a server side persisted session with an ID.
     if ($this instanceof Cookie) {
         return Str::random(40);
     }
     // We'll continue generating random IDs until we find an ID that is
     // not currently assigned to a session. This is almost definitely
     // going to happen on the first iteration.
     do {
         $session = $this->load($id = Str::random(40));
     } while (!is_null($session));
     return $id;
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:22,代码来源:driver.php


示例13: userSearchList

 public static function userSearchList($input)
 {
     $operator = stripos($input['searchval'], '*') ? 'LIKE' : '=';
     $val = str_replace("*", "", $input['searchval']);
     $refval = stripos($input['searchval'], '*') ? '%' . $val . '%' : $val;
     $allUser = User::left_join('users_profiles', 'users.userid', '=', 'users_profiles.userid')->where('icno', $operator, $refval)->or_where('fullname', $operator, $refval)->paginate(Config::get('system.pagination'));
     $datagrid = new Datagrid();
     $datagrid->setFields(array('userprofile/fullname' => Str::upper(Str::title(Lang::line('admin.fullname')->get()))));
     $datagrid->setFields(array('userprofile/emel' => Str::upper(Str::title(Lang::line('admin.activeemel')->get()))));
     $datagrid->setFields(array('userprofile/icno' => Str::upper(Str::title(Lang::line('admin.idno')->get()))));
     $datagrid->setFields(array('status' => Str::upper('Status')));
     $datagrid->setAction(Lang::line('global.edit')->get(), 'viewUser', true, array('userid'));
     $datagrid->setAction(Lang::line('global.delete')->get(), 'deleteAccount', true, array('userid'));
     $datagrid->setAction(Lang::line('global.reset')->get(), 'resetAccount', true, array('userid'));
     $datagrid->setTable('users', 'table table-bordered table-hover table-striped table-condensed');
     $datagrid->build($allUser, 'userid');
     return $datagrid->render();
 }
开发者ID:farhan4648gul,项目名称:developer-side,代码行数:18,代码来源:User.php


示例14: load

 /**
  * Load the session for the current request.
  *
  * @param  string  $id
  * @return void
  */
 public function load($id)
 {
     if (!is_null($id)) {
         $this->session = $this->driver->load($id);
     }
     // If the session doesn't exist or is invalid we will create a new session
     // array and mark the session as being non-existent. Some drivers, such as
     // the database driver, need to know whether it exists.
     if (is_null($this->session) or static::expired($this->session)) {
         $this->exists = false;
         $this->session = $this->driver->fresh();
     }
     // A CSRF token is stored in every session. The token is used by the Form
     // class and the "csrf" filter to protect the application from cross-site
     // request forgery attacks. The token is simply a random string.
     if (!$this->has(Session::csrf_token)) {
         $this->put(Session::csrf_token, Str::random(40));
     }
 }
开发者ID:perryhau,项目名称:Laravel-1,代码行数:25,代码来源:payload.php


示例15: genListData

 /**
  * Generate Data datagrid table
  *
  * @return void
  * @author 
  **/
 public static function genListData()
 {
     $allContent = Content::paginate(Config::get('system.pagination'));
     $datagrid = new Datagrid();
     $tableCol = DB::query('show columns from ' . Content::$table);
     foreach ($tableCol as $value) {
         if ($value->field != 'created_at' && $value->field != 'updated_at' && $value->field != Content::$key) {
             if (stristr($value->field, 'name')) {
                 $title = Str::upper(Lang::line('global.data')->get());
             } elseif (stristr($value->field, 'desc')) {
                 $title = Str::upper(Lang::line('global.desc')->get());
             } else {
                 $title = $value->field;
             }
             $datagrid->setFields(array($value->field => $title));
         }
     }
     $datagrid->setAction(Lang::line('global.edit')->get(), 'editData', true, array(Content::$key));
     $datagrid->setAction(Lang::line('global.delete')->get(), 'deleteData', true, array(Content::$key));
     $datagrid->setTable('contentGroup', 'table table-bordered table-hover table-striped table-condensed');
     $datagrid->build($allContent, Content::$key);
     return $datagrid->render();
 }
开发者ID:farhan4648gul,项目名称:developer-side,代码行数:29,代码来源:Content.php


示例16: format

 /**
  * Format a bundle and controller identifier into the controller's class name.
  *
  * @param  string  $bundle
  * @param  string  $controller
  * @return string
  */
 protected static function format($bundle, $controller)
 {
     return Bundle::class_prefix($bundle) . Str::classify($controller) . '_Controller';
 }
开发者ID:victoroliveira1605,项目名称:Laravel-Bootstrap,代码行数:11,代码来源:controller.php


示例17: getParameter

 protected function getParameter($key)
 {
     if (isset($_SERVER['CLI'][Str::upper($key)])) {
         return $_SERVER['CLI'][Str::upper($key)] == '' ? true : $_SERVER['CLI'][Str::upper($key)];
     } else {
         return false;
     }
 }
开发者ID:laravelbook,项目名称:framework3,代码行数:8,代码来源:seeder.php


示例18: validate_active_url

 /**
  * Validate that an attribute is an active URL.
  *
  * @param  string  $attribute
  * @param  mixed   $value
  * @return bool
  */
 protected function validate_active_url($attribute, $value)
 {
     $url = str_replace(array('http://', 'https://', 'ftp://'), '', Str::lower($value));
     return checkdnsrr($url);
 }
开发者ID:bamper,项目名称:laravel.com,代码行数:12,代码来源:validator.php


示例19: regenerate

 /**
  * Assign a new, random ID to the session.
  *
  * @return void
  */
 public function regenerate()
 {
     $this->session['id'] = Str::random(40);
     $this->exists = false;
 }
开发者ID:bamper,项目名称:laravel.com,代码行数:10,代码来源:payload.php


示例20: testUserCanBeRecalledViaCookie

 /**
  * Test the Auth::recall method.
  *
  * @group laravel
  */
 public function testUserCanBeRecalledViaCookie()
 {
     Session::$instance = new Payload($this->getMock('Laravel\\Session\\Drivers\\Driver'));
     $cookie = Crypter::encrypt('1|' . Str::random(40));
     Cookie::forever('authloginstub_remember', $cookie);
     $auth = new AuthLoginStub();
     $this->assertEquals('Taylor Otwell', $auth->user()->name);
     $this->assertTrue($auth->user()->id === $_SERVER['auth.login.stub']['user']);
 }
开发者ID:raykwok,项目名称:laravel,代码行数:14,代码来源:auth.test.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Exceptions\Handler类代码示例发布时间:2022-05-23
下一篇:
PHP Laravel\Config类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap