PhpSPA uses heredoc syntax to write HTML, CSS, and JavaScript inside PHP components. This plugin makes that code actually look good with proper syntax highlighting.
- 🎯 Highlights
<<<HTML,<<<CSS,<<<JS,<<<JAVASCRIPTheredocs - 🔄 Supports both heredoc and nowdoc (
<<<'HTML') - 📐 Variable interpolation:
{$name}in heredocs - ✨ Indented heredoc syntax (PHP 7.3+)
- Open Acode → Settings → Plugins
- Search for "PhpSPA Highlighter"
- Tap Install and restart
Just write your PhpSPA components normally:
<?php
class Button {
public function __render($name) {
return <<<HTML
<button class="btn" onclick="handleClick()">
Hello {$name}!
</button>
HTML;
}
public function styles($defaultColor) {
return <<<CSS
.btn {
padding: 10px 20px;
background: {$defaultColor};
color: white;
}
CSS;
}
public function script() {
return <<<JS
function handleClick() {
alert('Clicked!');
}
JS;
}
}That's it! The plugin automatically detects and highlights your heredoc blocks.
| Heredoc | Nowdoc | Language |
|---|---|---|
| <<<HTML | <<<'HTML' | HTML |
| <<<CSS | <<<'CSS' | CSS |
| <<<JS | <<<'JS' | JavaScript |
| <<<JAVASCRIPT | <<<'JAVASCRIPT' | JavaScript |
MIT
Made for the PhpSPA community ❤️