if (Str::startsWith($component, 'mail::')) {
return $component;
}
throw new InvalidArgumentException(
"Unable to locate a class or view for component [{$component}]."
);
}
/**
*
* @throws \InvalidArgumentException
*/
protected function componentString(string $component, array $attributes)
{
$class = $this->componentClass($component);
[$data, $attributes] = $this->partitionDataAndAttributes($class, $attributes);
$data = $data->mapWithKeys(function ($value, $key) {
return [Str::camel($key) => $value];
return preg_replace_callback($pattern, function (array $matches) {
$this->boundAttributes = [];
$attributes = $this->getAttributesFromAttributeString($matches['attributes']);
return $this->componentString($matches[1], $attributes);
}, $value);
}
/**
* Compile the self-closing tags within the given string.
)
(?<![\/=\-])
>
/x";
return preg_replace_callback($pattern, function (array $matches) {
$this->boundAttributes = [];
$attributes = $this->getAttributesFromAttributeString($matches['attributes']);
return $this->componentString($matches[1], $attributes);
* @throws \InvalidArgumentException
*/
public function compileTags(string $value)
{
$value = $this->compileSelfClosingTags($value);
$value = $this->compileOpeningTags($value);
$value = $this->compileClosingTags($value);
return $value;
}
*/
public function compile(string $value)
{
$value = $this->compileSlots($value);
return $this->compileTags($value);
}
/**
* Compile the tags within the given string.
*
return $value;
}
return (new ComponentTagCompiler(
$this->classComponentAliases, $this->classComponentNamespaces, $this
))->compile($value);
}
/**
* Replace the raw placeholders with the original code stored in the raw blocks.
*
[$this->footer, $result] = [[], ''];
// First we will compile the Blade component tags. This is a precompile style
// step which compiles the component Blade tags into @component directives
// that may be used by Blade. Then we should call any other precompilers.
$value = $this->compileComponentTags(
$this->compileComments($this->storeUncompiledBlocks($value))
);
foreach ($this->precompilers as $precompiler) {
$value = $precompiler($value);
if ($path) {
$this->setPath($path);
}
if (! is_null($this->cachePath)) {
$contents = $this->compileString($this->files->get($this->getPath()));
if (! empty($this->getPath())) {
$contents = $this->appendFilePath($contents);
}
// If this given view has expired, which means it has simply been edited since
// it was last compiled, we will re-compile the views so we can evaluate a
// fresh copy of the view. We'll pass the compiler the path of the view.
if (! isset($this->compiledOrNotExpired[$path]) && $this->compiler->isExpired($path)) {
$this->compiler->compile($path);
}
// Once we have the path to the compiled file, we will evaluate the paths with
// typical PHP just like any other templates. We also keep a stack of views
// which have been rendered for right exception messages to be generated.
*
* @return string
*/
protected function getContents()
{
return $this->engine->get($this->path, $this->gatherData());
}
/**
* Get the data bound to the view instance.
*
// clear out the sections for any separate views that may be rendered.
$this->factory->incrementRender();
$this->factory->callComposer($this);
$contents = $this->getContents();
// Once we've finished rendering the view, we'll decrement the render count
// so that each section gets flushed out next time a view is created and
// no old sections are staying around in the memory of an environment.
$this->factory->decrementRender();
* @throws \Throwable
*/
public function render(callable $callback = null)
{
try {
$contents = $this->renderContents();
$response = isset($callback) ? $callback($this, $contents) : null;
// Once we have the contents of the view, we will flush the sections if we are
// done rendering all views so that there is nothing left hanging over when
<div id="app">
<!--visual stuff starts here -->
<!-- by default, app('sage.view') is set to 'page.blade.php' -->
<?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
<!--visual stuff ends here -->
</div>
*
* @param string $template The path of the template to include.
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
InvalidArgumentException
|
---|
InvalidArgumentException: Unable to locate a class or view for component [alert]. at /home/forge/www.firstfriends.org/public/vendor/illuminate/view/Compilers/ComponentTagCompiler.php:311 at Illuminate\View\Compilers\ComponentTagCompiler->componentClass() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/Compilers/ComponentTagCompiler.php:235) at Illuminate\View\Compilers\ComponentTagCompiler->componentString() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/Compilers/ComponentTagCompiler.php:156) at Illuminate\View\Compilers\ComponentTagCompiler->Illuminate\View\Compilers\{closure}() at preg_replace_callback() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/Compilers/ComponentTagCompiler.php:151) at Illuminate\View\Compilers\ComponentTagCompiler->compileOpeningTags() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/Compilers/ComponentTagCompiler.php:90) at Illuminate\View\Compilers\ComponentTagCompiler->compileTags() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/Compilers/ComponentTagCompiler.php:76) at Illuminate\View\Compilers\ComponentTagCompiler->compile() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/Compilers/BladeCompiler.php:423) at Illuminate\View\Compilers\BladeCompiler->compileComponentTags() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/Compilers/BladeCompiler.php:255) at Illuminate\View\Compilers\BladeCompiler->compileString() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/Compilers/BladeCompiler.php:175) at Illuminate\View\Compilers\BladeCompiler->compile() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/Engines/CompilerEngine.php:62) at Illuminate\View\Engines\CompilerEngine->get() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/View.php:195) at Illuminate\View\View->getContents() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/View.php:178) at Illuminate\View\View->renderContents() (/home/forge/www.firstfriends.org/public/vendor/illuminate/view/View.php:147) at Illuminate\View\View->render() (/home/forge/www.firstfriends.org/public/wp-content/themes/sagetheme/index.php:54) at include('/home/forge/www.firstfriends.org/public/wp-content/themes/sagetheme/index.php') (/home/forge/www.firstfriends.org/public/wp-includes/template-loader.php:106) at require_once('/home/forge/www.firstfriends.org/public/wp-includes/template-loader.php') (/home/forge/www.firstfriends.org/public/wp-blog-header.php:19) at require('/home/forge/www.firstfriends.org/public/wp-blog-header.php') (/home/forge/www.firstfriends.org/public/index.php:17) |