Documentation

JsFunction
in package
implements JsExpression

A JavaScript function expression.

Table of Contents

Interfaces

JsExpression
For use with Js::encode().

Properties

$args  : array<string|int, string>
$arrow  : bool
$function  : string
$inline  : bool
$strip  : bool

Methods

__construct()  : mixed
__toString()  : mixed
render()  : string
Render the expression as a string.

Properties

Methods

__construct()

public __construct(array<string|int, mixed> $args, string $function[, bool $arrow = true ][, bool $inline = false ][, bool $strip = false ]) : mixed
Parameters
$args : array<string|int, mixed>

argument names

$function : string

code body

$arrow : bool = true

use arrow syntax

$inline : bool = false

an implicit return

$strip : bool = false

strip whitespace from the function body

__toString()

public __toString() : mixed
Tags
inheritdoc

render()

Render the expression as a string.

public render() : string
Tags
inheritdoc
Return values
string
On this page

Search results