CreateTheme
class Cms\Console\CreateTheme
extends Winter\Storm\Scaffold\GeneratorCommand
implements
Symfony\Component\Console\Command\SignalableCommandInterface
Extends
Class | Description |
---|---|
GeneratorCommand
|
Generator command. |
Traits
Trait | Description |
---|---|
HandlesCleanup
|
Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class. |
ProvidesAutocompletion
|
Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class. |
Properties
protected
static
$defaultName
:
string
|
null
= "create:theme"
The default command name for lazy loading.
protected
$description
:
string
= "Creates a new theme."
The console command description.
protected
$nameFrom
:
string
= "theme"
The argument that the generated class name comes from
protected
$signature
:
string
= "create:theme\n {theme : The name of the theme to create. <info>(eg: MyTheme)<\/info>}\n {scaffold? : The base theme scaffold to use <info>(eg: less, tailwind)<\/info>}\n {--f|force : Overwrite existing files with generated files.}\n {--uninspiring : Disable inspirational quotes}\n "
The name and signature of this command.
protected
$themeScaffolds
:
array
= {"less":{"scaffold\/theme\/less\/assets\/js\/app.stub":"assets\/js\/app.js","scaffold\/theme\/less\/assets\/less\/theme.stub":"assets\/less\/theme.less","scaffold\/theme\/less\/layouts\/default.stub":"layouts\/default.htm","scaffold\/theme\/less\/pages\/404.stub":"pages\/404.htm","scaffold\/theme\/less\/pages\/error.stub":"pages\/error.htm","scaffold\/theme\/less\/pages\/home.stub":"pages\/home.htm","scaffold\/theme\/less\/partials\/meta\/seo.stub":"partials\/meta\/seo.htm","scaffold\/theme\/less\/partials\/meta\/styles.stub":"partials\/meta\/styles.htm","scaffold\/theme\/less\/partials\/site\/header.stub":"partials\/site\/header.htm","scaffold\/theme\/less\/partials\/site\/footer.stub":"partials\/site\/footer.htm","scaffold\/theme\/less\/theme.stub":"theme.yaml","scaffold\/theme\/less\/version.stub":"version.yaml"},"tailwind":{"scaffold\/theme\/tailwind\/assets\/src\/css\/base.stub":"assets\/src\/css\/base.css","scaffold\/theme\/tailwind\/assets\/src\/css\/custom.stub":"assets\/src\/css\/custom.css","scaffold\/theme\/tailwind\/assets\/src\/css\/theme.stub":"assets\/src\/css\/theme.css","scaffold\/theme\/tailwind\/assets\/src\/js\/theme.stub":"assets\/src\/js\/theme.js","scaffold\/theme\/tailwind\/lang\/en\/lang.stub":"lang\/en\/lang.php","scaffold\/theme\/tailwind\/layouts\/default.stub":"layouts\/default.htm","scaffold\/theme\/tailwind\/pages\/404.stub":"pages\/404.htm","scaffold\/theme\/tailwind\/pages\/error.stub":"pages\/error.htm","scaffold\/theme\/tailwind\/pages\/home.stub":"pages\/home.htm","scaffold\/theme\/tailwind\/partials\/meta\/seo.stub":"partials\/meta\/seo.htm","scaffold\/theme\/tailwind\/partials\/meta\/styles.stub":"partials\/meta\/styles.htm","scaffold\/theme\/tailwind\/partials\/site\/header.stub":"partials\/site\/header.htm","scaffold\/theme\/tailwind\/partials\/site\/footer.stub":"partials\/site\/footer.htm","scaffold\/theme\/tailwind\/.gitignore.stub":".gitignore","scaffold\/theme\/tailwind\/package.stub":"package.json","scaffold\/theme\/tailwind\/README.stub":"README.md","scaffold\/theme\/tailwind\/tailwind.config.stub":"tailwind.config.js","scaffold\/theme\/tailwind\/theme.stub":"theme.yaml","scaffold\/theme\/tailwind\/version.stub":"version.yaml","scaffold\/theme\/tailwind\/winter.mix.stub":"winter.mix.js"}}
Available theme scaffolds and their types
protected
$type
:
string
= "Theme"
The type of class being generated.
inherited protected $files : Winter\Storm\Filesystem\Filesystem
The filesystem instance.
inherited protected $laravel : Winter\Storm\Foundation\Application
inherited
protected
$replaces
:
array
= []
List of commands that this command replaces (aliases)
inherited
protected
$reservedNames
:
string[]
= ["__halt_compiler","abstract","and","array","as","break","callable","case","catch","class","clone","const","continue","declare","default","die","do","echo","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","eval","exit","extends","final","finally","fn","for","foreach","function","global","goto","if","implements","include","include_once","instanceof","insteadof","interface","isset","list","namespace","new","or","print","private","protected","public","require","require_once","return","static","switch","throw","trait","try","unset","use","var","while","xor","yield"]
Reserved names that cannot be used for generation.
inherited
protected
$stubs
:
array
= []
A mapping of stub to generated file.
inherited
protected
$vars
:
array
= []
An array of variables to use in stubs.
Methods
public makeStub (string $stubName)
Make a single stub.
Property | Type | Description |
---|---|---|
$stubName | string |
string
The source filename for the stub. |
public suggestScaffoldValues () : array
Auto suggest valid theme scaffold values
protected getDestinationPath () : string
Get the plugin path from the input.
protected getNameInput () : string
Get the desired class name from the input.
protected prepareVars () : array
Prepare variables for stubs.
inherited public __construct () : void
Create a new controller creator command instance.
inherited
public
alert (string $string, int | string | null $verbosity = null
)
: void
Write a string in an alert box.
Property | Type | Description |
---|---|---|
$string | string |
string
|
$verbosity | int | string | null |
int | string | null
|
inherited public complete (Symfony\Component\Console\Completion\CompletionInput $input, Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
Provide autocompletion for this command's input
Property | Type | Description |
---|---|---|
$input | Symfony\Component\Console\Completion\CompletionInput |
Symfony\Component\Console\Completion\CompletionInput
|
$suggestions | Symfony\Component\Console\Completion\CompletionSuggestions |
Symfony\Component\Console\Completion\CompletionSuggestions
|
inherited
public
error (string $string, int | string | null $verbosity = null
)
: void
Write a string as error output.
Property | Type | Description |
---|---|---|
$string | string |
string
|
$verbosity | int | string | null |
int | string | null
|
inherited public getSubscribedSignals () : array
Returns the process signals this command listens to
inherited public handle () : int | bool | null
Execute the console command.
inherited public handleSignal (integer $signal) : void
Handle the provided Unix process signal
Property | Type | Description |
---|---|---|
$signal | integer |
integer
|
inherited public handleWindowsSignal (integer $event) : void
Handle the provided Windows process singal.
Property | Type | Description |
---|---|---|
$event | integer |
integer
|
inherited public makeStubs () : void
Make all stubs.
inherited protected getDestinationForStub (string $stubName) : string
Get the destination path for the provided stub name
Property | Type | Description |
---|---|---|
$stubName | string |
string
|
inherited protected getSourcePath () : string
Get the base path to source stub files from
inherited protected isReservedName (string $name) : bool
Checks whether the given name is reserved.
Property | Type | Description |
---|---|---|
$name | string |
string
|
inherited protected makeDirectory (string $path) : void
Build the directory for the class if necessary.
Property | Type | Description |
---|---|---|
$path | string |
string
|
inherited protected modifyString (string | array $type, string $string) : string
Internal helper that handles modify a string, with extra logic.
Property | Type | Description |
---|---|---|
$type | string | array |
string | array
|
$string | string |
string
|
inherited protected processVars (array $vars) : array
Converts all variables to available modifier and case formats.
Syntax is CASE_MODIFIER_KEY, eg: lower_plural_xxx
Property | Type | Description |
---|---|---|
$vars | array |
array
|