CreatesNewPageSourceFile
in package
uses
InteractsWithDirectories
Scaffold a new Markdown, Blade, or documentation page.
Table of Contents
Properties
- $customContent : string|null
- $filename : string
- $force : bool
- $outputPath : string
- $pageClass : HydePage>
- $subDir : string
- $title : string
Methods
- __construct() : mixed
- save() : string
- createBladeFile() : void
- createDocumentationFile() : void
- createMarkdownFile() : void
- failIfFileCannotBeSaved() : void
- fileName() : string
- formatIdentifier() : string
- getBladePageContent() : string
- getMarkdownPageContent() : string
- makeOutputPath() : string
- needsDirectories() : void
- Ensure the supplied directories exist by creating them if they don't.
- needsDirectory() : void
- Ensure the supplied directory exist by creating it if it does not.
- needsParentDirectory() : void
- Ensure the supplied file's parent directory exists by creating it if it does not.
- normalizeSubdirectory() : string
- parseTitle() : string
- validateType() : void
Properties
$customContent
protected
string|null
$customContent
$filename
protected
string
$filename
$force
protected
bool
$force
$outputPath
protected
string
$outputPath
$pageClass
protected
HydePage>
$pageClass
$subDir
protected
string
$subDir
= ''
$title
protected
string
$title
Methods
__construct()
public
__construct(string $title[, string $pageClass = MarkdownPage::class ][, bool $force = false ][, string|null $customContent = null ]) : mixed
Parameters
- $title : string
- $pageClass : string = MarkdownPage::class
- $force : bool = false
- $customContent : string|null = null
save()
public
save() : string
Return values
stringcreateBladeFile()
protected
createBladeFile() : void
createDocumentationFile()
protected
createDocumentationFile() : void
createMarkdownFile()
protected
createMarkdownFile() : void
failIfFileCannotBeSaved()
protected
failIfFileCannotBeSaved(string $path) : void
Parameters
- $path : string
fileName()
protected
fileName(string $title) : string
Parameters
- $title : string
Return values
stringformatIdentifier()
protected
formatIdentifier() : string
Return values
stringgetBladePageContent()
protected
getBladePageContent() : string
Return values
stringgetMarkdownPageContent()
protected
getMarkdownPageContent() : string
Return values
stringmakeOutputPath()
protected
makeOutputPath(HydePage> $pageClass) : string
Parameters
- $pageClass : HydePage>
Return values
stringneedsDirectories()
Ensure the supplied directories exist by creating them if they don't.
protected
static needsDirectories(array<string|int, string> $directories) : void
Parameters
- $directories : array<string|int, string>
-
array with relative file paths to the directories
needsDirectory()
Ensure the supplied directory exist by creating it if it does not.
protected
static needsDirectory(string $directory) : void
Parameters
- $directory : string
-
relative file path to the directory
needsParentDirectory()
Ensure the supplied file's parent directory exists by creating it if it does not.
protected
static needsParentDirectory(string $file[, int $levels = 1 ]) : void
Parameters
- $file : string
- $levels : int = 1
normalizeSubdirectory()
protected
normalizeSubdirectory(string $title) : string
Parameters
- $title : string
Return values
stringparseTitle()
protected
parseTitle(string $title) : string
Parameters
- $title : string
Return values
stringvalidateType()
protected
validateType(string $pageClass) : void
Parameters
- $pageClass : string