当前位置: 首页>>代码示例>>PHP>>正文


PHP files::makeFile方法代码示例

本文整理汇总了PHP中files::makeFile方法的典型用法代码示例。如果您正苦于以下问题:PHP files::makeFile方法的具体用法?PHP files::makeFile怎么用?PHP files::makeFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在files的用法示例。


在下文中一共展示了files::makeFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 function execute()
 {
     // Make views
     $files = new files($this->files->getClass());
     $files->setFeature("photo");
     $files->makeFile("crud/view.images", $this->directory . "/views/images.blade.php");
     // Change mainFoto input on read
     $analyzeFile = new analyzeFile($this->directory . "/views/create.blade.php");
     $analyzeFile->waitForFunctions();
     $search = 'name = \'{{$mainFoto}}\'';
     $search = $files->replace($search);
     $line = $analyzeFile->getLineWhere($search);
     $analyzeFile->changeLine($line, "");
     // Remove line
     $analyzeFile->changeLine($line + 1, "");
     $analyzeFile->changeLine($line - 1, "");
     $analyzeFile->changeLine($line - 2, "");
     $res = $analyzeFile->finishWait();
     $analyzeFile = new analyzeFile($this->directory . "/controllers/" . ucfirst($this->files->getClass()->id) . "Controller.php");
     $analyzeFile->waitForFunctions();
     $search = 'Input::get(\'{{$mainFoto}}\')';
     $search = $files->replace($search);
     $analyzeFile->replaceLineWhere($search, "");
     $res = $analyzeFile->finishWait();
     $analyzeFile = new analyzeFile($this->directory . "/views/edit.blade.php");
     $analyzeFile->waitForFunctions();
     $search = '{{$data->{{$mainFoto}}}}';
     $search = $files->replace($search);
     $line = $analyzeFile->getLineWhere($search);
     $analyzeFile->changeLine($line, "");
     // Remove line
     $analyzeFile->changeLine($line + 1, "");
     $analyzeFile->changeLine($line - 1, "");
     $analyzeFile->changeLine($line - 2, "");
     $res = $analyzeFile->finishWait();
     // add in Menu
     $analyzeFile = new analyzeFile("result/theme/views/layouts/master.blade.php");
     $analyzeFile->waitForFunctions();
     $search = '@if(Request::is(\'{{$id}}/*\') && isset($id))';
     $search = $files->replace($search);
     $add = '						<a href="{{url(\'{{$id}}/images\'.\'/\'.$id)}}">Images</a>';
     $add = $files->replace($add);
     $analyzeFile->addAfterLine($search, $add);
     $res = $analyzeFile->finishWait();
 }
开发者ID:weblabormx,项目名称:crudMaker,代码行数:45,代码来源:photo.php

示例2: execute

    function execute()
    {
        // Make  files
        $files = new files($this->files->getClass());
        $files->setFeature("user");
        $files->makeFile("crud/filters.user", $this->directory . "/filters.php");
        $files->makeFile("crud/view.login", $this->directory . "/views/login.blade.php");
        // replace texts
        $analyzeFile = new analyzeFile($this->directory . "/models/" . ucfirst($this->files->getClass()->id) . ".php");
        $analyzeFile->waitForFunctions();
        // Change models text
        $replace = 'class {{$name}} extends Eloquent {';
        $replace = $files->replace($replace);
        $for = "use Illuminate\\Auth\\UserInterface;\nuse Illuminate\\Auth\\Reminders\\RemindableInterface;\n\nclass User extends Eloquent implements UserInterface, RemindableInterface {";
        $analyzeFile->replace($replace, $for);
        $res = $analyzeFile->finishWait();
        // Change controllers text
        $analyzeFile = new analyzeFile($this->directory . "/controllers/" . ucfirst($this->files->getClass()->id) . "Controller.php");
        $analyzeFile->waitForFunctions();
        $replace = '{{$name}}::';
        $replace = $files->replace($replace);
        $for = 'User::';
        $for = $files->replace($for);
        $analyzeFile->replace($replace, $for);
        $replace = 'new {{$name}}';
        $replace = $files->replace($replace);
        $for = 'new User';
        $for = $files->replace($for);
        $analyzeFile->replace($replace, $for);
        $res = $analyzeFile->finishWait();
        // Change password input on read
        $analyzeFile = new analyzeFile($this->directory . "/views/read.blade.php");
        $analyzeFile->waitForFunctions();
        $search = '{{$data->{{$password}}}}';
        $search = $files->replace($search);
        $line = $analyzeFile->getLineWhere($search);
        $analyzeFile->changeLine($line, "");
        // Remove line
        $analyzeFile->changeLine($line + 1, "");
        $analyzeFile->changeLine($line - 1, "");
        $analyzeFile->changeLine($line - 2, "");
        $res = $analyzeFile->finishWait();
        // Change password input on update
        $analyzeFile = new analyzeFile($this->directory . "/views/edit.blade.php");
        $analyzeFile->waitForFunctions();
        $search = 'value = \'{{$data->{{$password}}}}\'';
        $search = $files->replace($search);
        $analyzeFile->replace($search, "");
        $res = $analyzeFile->finishWait();
        // add in Menu
        $analyzeFile = new analyzeFile("result/theme/views/layouts/master.blade.php");
        $analyzeFile->waitForFunctions();
        $search = '<a href="#">{{$title}}</a>';
        $search = $files->replace($search);
        $line = $analyzeFile->getLineWhere($search);
        $add = '			    <div class="w3-dropdown-content w3-card-4">
					@if(Auth::check())
				  		<a href="{{url(\'{{$id}}/logout\')}}">Logout</a>
				  	@else
				  		<a href="{{url(\'{{$id}}/login\')}}">Login</a>
				  	@endif
';
        $add = $files->replace($add);
        $analyzeFile->changeLine($line + 1, $add);
        $res = $analyzeFile->finishWait();
    }
开发者ID:weblabormx,项目名称:crudMaker,代码行数:66,代码来源:user.php

示例3: files

$files->makeFile("explorer/routes", $directorio . "/routes.php");
// Make the json
$files->makeFile("json", $directorio . "/module.json");
// Make the views
$files->makeDirectory($directorio . "/views");
$files->makeFile("explorer/view.home", $directorio . "/views/home.blade.php");
foreach ($classes as $class) {
    // Make models folder and files
    $files = new files($class);
    // Make general directory
    $directorio = $directoriofinal . "/" . $class->id;
    $files->makeDirectory($directorio);
    $name = ucfirst($class->id);
    // Make the model
    $files->makeDirectory($directorio . "/models");
    $files->makeFile("crud/model", $directorio . "/models/" . $name . ".php");
    // Make the controllers
    $files->makeDirectory($directorio . "/controllers");
    $files->makeFile("crud/controller", $directorio . "/controllers/" . $name . "Controller.php");
    // Make the routes
    $files->makeFile("crud/routes", $directorio . "/routes.php");
    // Make the json
    $files->makeFile("json", $directorio . "/module.json");
    // Make the views
    $files->makeDirectory($directorio . "/views");
    foreach ($class->make as $make) {
        $files->makeFile("crud/view.{$make}", $directorio . "/views/{$make}.blade.php");
    }
    $files->addFeatures($directorio);
}
header("Location: index3.html");
开发者ID:weblabormx,项目名称:crudMaker,代码行数:31,代码来源:step2.php


注:本文中的files::makeFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。