當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Bundle::class_prefix方法代碼示例

本文整理匯總了PHP中Laravel\Bundle::class_prefix方法的典型用法代碼示例。如果您正苦於以下問題:PHP Bundle::class_prefix方法的具體用法?PHP Bundle::class_prefix怎麽用?PHP Bundle::class_prefix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Laravel\Bundle的用法示例。


在下文中一共展示了Bundle::class_prefix方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

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

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

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

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

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

示例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(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\Bundle::class_prefix方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。