Scaffolder v2.0.0
  • Namespace
  • Class

Namespaces

  • Scaffolder
    • Commands
    • Compilers
      • Core
        • Api
      • Layout
      • View

Classes

  • Scaffolder\Commands\BaseCommand
  • Scaffolder\Commands\ClearCacheCommand
  • Scaffolder\Commands\GeneratorCommand
  • Scaffolder\Commands\InitializeApiCommand
  • Scaffolder\Compilers\AbstractCompiler
  • Scaffolder\Compilers\AbstractCoreCompiler
  • Scaffolder\Compilers\AbstractViewCompiler
  • Scaffolder\Compilers\Core\Api\ApiControllerCompiler
  • Scaffolder\Compilers\Core\Api\ApiModelCompiler
  • Scaffolder\Compilers\Core\Api\ApiRouteCompiler
  • Scaffolder\Compilers\Core\ControllerCompiler
  • Scaffolder\Compilers\Core\MigrationCompiler
  • Scaffolder\Compilers\Core\ModelCompiler
  • Scaffolder\Compilers\Core\RouteCompiler
  • Scaffolder\Compilers\Layout\CreateLayoutCompiler
  • Scaffolder\Compilers\Layout\EditLayoutCompiler
  • Scaffolder\Compilers\Layout\PageLayoutCompiler
  • Scaffolder\Compilers\View\CreateViewCompiler
  • Scaffolder\Compilers\View\DashboardViewCompiler
  • Scaffolder\Compilers\View\EditViewCompiler
  • Scaffolder\Compilers\View\IndexViewCompiler
  • Scaffolder\Compilers\View\LoginViewCompiler
  • Scaffolder\Compilers\View\WelcomeViewCompiler
  • Scaffolder\ScaffolderServiceProvider
 1 <?php
 2 
 3 namespace Scaffolder\Compilers\Layout;
 4 
 5 use Illuminate\Support\Facades\File;
 6 use Scaffolder\Compilers\AbstractViewCompiler;
 7 use Scaffolder\Support\Contracts\ScaffolderThemeExtensionInterface;
 8 use Scaffolder\Support\FileToCompile;
 9 use Scaffolder\Support\PathParser;
10 use stdClass;
11 
12 class EditLayoutCompiler extends AbstractViewCompiler
13 {
14     /**
15      * Compiles the edit layout.
16      *
17      * @param $stub
18      * @param $modelName
19      * @param $modelData
20      * @param \stdClass $scaffolderConfig
21      * @param $hash
22      * @param \Scaffolder\Support\Contracts\ScaffolderThemeExtensionInterface $themeExtension
23      * @param \Scaffolder\Support\Contracts\ScaffolderExtensionInterface[] $extensions
24      * @param null $extra
25      *
26      * @return string
27      */
28     public function compile($stub, $modelName, $modelData, stdClass $scaffolderConfig, $hash, ScaffolderThemeExtensionInterface $themeExtension, array $extensions, $extra = null)
29     {
30         $this->stub = $stub;
31 
32         return $this->store(null, $scaffolderConfig, $themeExtension->runAfterEditLayoutIsCompiled($this->stub, $scaffolderConfig), new FileToCompile(null, null));
33     }
34 
35     /**
36      * Store the compiled stub.
37      *
38      * @param $modelName
39      * @param \stdClass $scaffolderConfig
40      * @param $compiled
41      * @param \Scaffolder\Support\FileToCompile $fileToCompile
42      *
43      * @return string
44      */
45     protected function store($modelName, stdClass $scaffolderConfig, $compiled, FileToCompile $fileToCompile)
46     {
47         $path = PathParser::parse($scaffolderConfig->paths->views) . 'layouts/edit.blade.php';
48 
49         File::put($path, $compiled);
50 
51         return $path;
52     }
53 }
54 
Scaffolder v2.0.0 API documentation generated by ApiGen