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


PHP Str::classify方法代码示例

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


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

示例1: 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

示例2: 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

示例3: resolve

 /**
  * Resolve an array of migration instances.
  *
  * @param  array  $migrations
  * @return array
  */
 protected function resolve($migrations)
 {
     $instances = array();
     foreach ($migrations as $migration) {
         $migration = (array) $migration;
         // The migration array contains the bundle name, so we will get the
         // path to the bundle's migrations and resolve an instance of the
         // migration using the name.
         $bundle = $migration['bundle'];
         $path = Bundle::path($bundle) . 'migrations/';
         // Migrations are not resolved through the auto-loader, so we will
         // manually instantiate the migration class instances for each of
         // the migration names we're given.
         $name = $migration['name'];
         require_once $path . $name . EXT;
         // Since the migration name will begin with the numeric ID, we'll
         // slice off the ID so we are left with the migration class name.
         // The IDs are for sorting when resolving outstanding migrations.
         //
         // Migrations that exist within bundles other than the default
         // will be prefixed with the bundle name to avoid any possible
         // naming collisions with other bundle's migrations.
         $prefix = Bundle::class_prefix($bundle);
         $class = $prefix . \Laravel\Str::classify(substr($name, 18));
         $migration = new $class();
         // When adding to the array of instances, we will actually
         // add the migration instance, the bundle, and the name.
         // This allows the migrator to log the bundle and name
         // when the migration is executed.
         $instances[] = compact('bundle', 'name', 'migration');
     }
     // At this point the migrations are only sorted within their
     // bundles so we need to resort them by name to ensure they
     // are in a consistent order.
     usort($instances, function ($a, $b) {
         return strcmp($a['name'], $b['name']);
     });
     return $instances;
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:45,代码来源:resolver.php

示例4: 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

示例5: class_prefix

 /**
  * Get the class prefix for a given bundle.
  *
  * @param  string  $bundle
  * @return string
  */
 public static function class_prefix($bundle)
 {
     return $bundle !== DEFAULT_BUNDLE ? Str::classify($bundle) . '_' : '';
 }
开发者ID:richthegeek,项目名称:Sasshare,代码行数:10,代码来源:bundle.php

示例6: format

 /**
  * Format a bundle and task into a task class name.
  *
  * @param  string  $bundle
  * @param  string  $task
  * @return string
  */
 protected static function format($bundle, $task)
 {
     $prefix = Bundle::class_prefix($bundle);
     return '\\' . $prefix . Str::classify($task) . '_Task';
 }
开发者ID:richthegeek,项目名称:Sasshare,代码行数:12,代码来源:command.php

示例7: format

 /**
  * Format a bundle and controller identifier into the Form's or Page's class name.
  *
  * @param  string  $bundle
  * @param  string  $controller
  * 
  * @return string
  */
 protected static function format($bundle, $path, $type)
 {
     return Bundle::class_prefix($bundle) . Str::classify($path) . '_' . ucfirst($type);
 }
开发者ID:reith2004,项目名称:components,代码行数:12,代码来源:module.php

示例8: 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(path('sys') . 'cli/tasks/migrate/stub' . EXT);
     // 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 bundle.
     $class = Bundle::class_prefix($bundle) . Str::classify($migration);
     return str_replace('{{class}}', $class, $stub);
 }
开发者ID:bamper,项目名称:laravel.com,代码行数:16,代码来源:migrator.php


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