本文整理汇总了PHP中Illuminate\View\Factory::file方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::file方法的具体用法?PHP Factory::file怎么用?PHP Factory::file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\View\Factory
的用法示例。
在下文中一共展示了Factory::file方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$data = ['table' => $this->argument('table'), 'attachment' => $this->argument('attachment'), 'after' => $this->argument('after')];
// Create filename
$file = base_path("database/migrations/" . date('Y_m_d_His') . "_add_{$data['attachment']}_fields_to_{$data['table']}_table.php");
// Save the new migration to disk using the MediaSort migration view.
$migration = $this->view->file(realpath(__DIR__ . '/../../resources/views/migration.blade.php'), $data)->render();
$this->file->put($file, $migration);
// Print a created migration message to the console.
$this->info("Created migration: {$file}");
}
示例2: rendered
/**
* Renders the given template path, and returns the resultant HTTP response.
*
* @param string $path - The path to the template to be rendered.
* @param array $data - The data to pass into the template.
*
* @return Response
*/
public function rendered($path, array $data)
{
// Format path.
$path = $this->container->get('settings')['templatePath'] . DIRECTORY_SEPARATOR . $path;
$path = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);
$path .= '.blade.php';
$response = $this->container['response'];
/* @var Response $response */
$response->getBody()->write($this->factory->file($path, $data)->render());
return $response;
}
示例3: file
/**
* Get the evaluated view contents for the given view.
*
* @param string $path
* @param array $data
* @param array $mergeData
* @return \Illuminate\View\View
* @static
*/
public static function file($path, $data = array(), $mergeData = array())
{
return \Illuminate\View\Factory::file($path, $data, $mergeData);
}
示例4: buildContent
protected function buildContent()
{
$view = $this->view->file(__DIR__ . '/../../../views/content.blade.php');
$view->content = $this->content;
return $view;
}