本文整理汇总了PHP中Illuminate\Console\GeneratorCommand::replaceClass方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneratorCommand::replaceClass方法的具体用法?PHP GeneratorCommand::replaceClass怎么用?PHP GeneratorCommand::replaceClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Console\GeneratorCommand
的用法示例。
在下文中一共展示了GeneratorCommand::replaceClass方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: replaceClass
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
$noControllerName = str_replace('Controller', '', $this->getNameInput());
$dummyRoute = config('administr.prefix') . '.' . str_plural(strtolower(snake_case($noControllerName, '-')));
$stub = str_replace('dummyroute', $dummyRoute, $stub);
$appNamespace = $this->getLaravel()->getNamespace();
$dummyModel = str_singular($noControllerName);
$dummyModelNamespaced = $appNamespace . 'Models\\' . $dummyModel;
$stub = str_replace('DummyModelNamespaced', $dummyModelNamespaced, $stub);
$stub = str_replace('DummyModel', $dummyModel, $stub);
$dummyForm = str_singular($noControllerName) . 'Form';
$dummyFormNamespaced = $appNamespace . 'Http\\Forms\\' . $dummyForm;
$stub = str_replace('DummyFormNamespaced', $dummyFormNamespaced, $stub);
$stub = str_replace('DummyForm', $dummyForm, $stub);
$dummyListView = str_plural($noControllerName) . 'ListView';
$dummyListViewNamespaced = $appNamespace . 'Http\\ListViews\\' . $dummyListView;
$stub = str_replace('DummyListViewNamespaced', $dummyListViewNamespaced, $stub);
$stub = str_replace('DummyListView', $dummyListView, $stub);
$viewPath = config('administr.viewPath');
if (strlen($viewPath) > 0) {
$viewPath .= '.';
}
$dummyView = $viewPath . str_plural(snake_case(class_basename($noControllerName), '-'));
$stub = str_replace('dummyview', $dummyView, $stub);
return $stub;
}
示例2: replaceClass
/**
* Replace the class name for the given stub.
*
* @param string $stub
* @param string $name
*
* @return string
*/
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
return str_replace(['DummyModelNamespace', 'DummyModel'], [$this->option('model'), class_basename($this->option('model'))], $stub);
}
示例3: replaceClass
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
$noListViewName = str_replace('ListView', '', $this->getNameInput());
$dummyRoute = config('administr.prefix') . '.' . str_plural(strtolower(snake_case($noListViewName, '-')));
$stub = str_replace('dummyroute', $dummyRoute, $stub);
return $stub;
}
示例4: replaceClass
/**
* Replace the class name for the given stub.
*
* @param string $stub
* @param string $name
* @return string
*/
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
$parseClass = $this->option('parse-class') ?: $this->argument('name');
return str_replace('{{parseClass}}', $parseClass, $stub);
}
示例5: replaceClass
/**
* @param string $stub
* @param string $name
*
* @return mixed
*/
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
return str_replace('DummyDatetime', Carbon::now()->toDateTimeString(), $stub);
}
示例6: replaceClass
/**
* Replace the class name for the given stub.
*
* @param string $stub
* @param string $name
* @return string
*/
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
return str_replace('{{command}}', $this->option('command'), $stub);
}
示例7: replaceClass
/**
* Replace the class name for the given stub.
*
* @param string $stub
* @param string $name
*
* @return string
*/
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
$stub = str_replace('DummyDatetime', Carbon::now()->toDateTimeString(), $stub);
return str_replace('dummy:command', $this->option('command'), $stub);
}
示例8: replaceClass
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
return str_replace('DummyName', trim(Str::snake($this->argument('name'))), $stub);
}
示例9: replaceClass
/**
* Replace the class name for the given stub.
*
* @param string $stub
* @param string $name
* @return string
*/
protected function replaceClass($stub, $name)
{
$stub = parent::replaceClass($stub, $name);
return str_replace('{{request.namespace}}', $this->laravel['config']['namespaces.requests'], $stub);
}