san-ssr-target-php
v2.7.0
Published
San SSR code generation targiting PHP
Downloads
302
Readme
san-ssr-target-php
Install
Supported Environment
- PHP 5 >= 5.3.0, PHP 7
npm i san san-ssr san-ssr-target-php
CLI Usage
Command line interface:
san-ssr --target php --compile '{"nsPrefix":"demo\\"}' ./component.ts > ssr.php
Programmatic Interface
Pass 'php'
as the second parameter of SanProject
[SanProject#compile(filepath, target, options)][.compile()] method.
TypeScript:
import { Target, SanProject } from 'san-ssr'
import { writeFileSync } from 'fs'
const project = new SanProject()
const targetCode = project.compile('src/component.ts', 'php')
writeFileSync('ssr.php', targetCode)
Or in JavaScript:
import { Target, SanProject } from 'san-ssr'
import { writeFileSync } from 'fs'
const project = new SanProject()
const targetCode = project.compile('src/component.ts', 'php')
writeFileSync('ssr.php', targetCode)