# phpman > man > erubis(1)

[ERUBIS(1)](https://www.chedong.com/phpMan.php/man/ERUBIS/1/markdown)                                   User Commands                                  [ERUBIS(1)](https://www.chedong.com/phpMan.php/man/ERUBIS/1/markdown)



## NAME
       erubis - eRuby style template engine for multiple languages

## SYNOPSIS
       **erubis** [.._options_..] [_file_ ...]

## DESCRIPTION
       Embedded templating engine for multiple languages.  Erubis will take a template file as input
       and output code to convey that data in the language specified.   The  following  output  lan‐
       guages are supported:

               * Ruby
               * PHP
               * C
               * Java
               * Scheme
               * Perl
               * JavaScript

## OPTIONS
### -h --help
              help

### -v

### -x

### -X

### -N

### -U

### -C

### -b

### -z

### -e

### -p
              embedded pattern (default '<% %>')

### -l
              convert but no execute (ruby/php/c/java/scheme/perl/js)

### -E
              enhancer names (Escape, PercentLine, BiPattern, ...)

### -I
              library include path

### -K
              kanji code (euc/sjis/utf8) (default none)

### -c
              context data string (yaml inline style or ruby code)

### -f
              context data file ('*.yaml', '*.yml', or '*.rb')

### -T

### -S

### -B

       **--pi**=_name_
              parse '<?name ... ?>' instead of '<% ... %>'

### supported properties:
              * (common)

       **--escapefunc**=_nil_
              : escape function name

       **--pattern=**"<% %>"
              : embed pattern

       **--trim**=_true_
              : trim spaces around <% ... %>

       **--preamble**=_nil_
              : preamble (no preamble when false)

       **--postamble**=_nil_
              : postamble (no postamble when false)

       **--escape**=_nil_
              : escape expression or not in default

              * (basic) * (pi)

       **--pi=**"rb"
              : PI (Processing Instrunctions) name

       **--embchar=**"@"
              : char for embedded expression pattern('@{...}@')

              * ruby * php * c

       **--indent=**""
              : indent spaces (ex. '  ')

       **--out=**"stdout"
              : output file pointer name

              * java

       **--indent=**""
              : indent spaces (ex. '  ')

       **--buf=**"_buf"
              : output buffer name

       **--bufclass=**"StringBuffer" : output buffer class (ex. 'StringBuilder')

              * scheme

       **--func=**"_add"
              : function name (ex. 'display')

              * perl

       **--func=**"print"
              : function name

              * javascript

       **--docwrite**=_true_
              : use 'document.write()' when true

## EXAMPLES
       Run 'erubis -l php example.ephp' to convert the embedded document to php code.

### example.ephp:
        <?xml version="1.0"?>
        <html>
         <body>
          <p>Hello <%= $user %>!</p>
          <table>
           <tbody>
            <% $i = 0; %>
            <% foreach ($list as $item) { %>
            <%   $i++; %>
            <tr bgcolor="<%= $i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' %>">
             <td><%= $i %></td>
             <td><%== $item %></td>
            </tr>
            <% } %>
           </tbody>
          </table>
         </body>
        </html>


## SEE ALSO
       <http://rubyforge.org/projects/erubis/>



erubis 2.6.2                                January 2009                                   [ERUBIS(1)](https://www.chedong.com/phpMan.php/man/ERUBIS/1/markdown)
