Phoenix.HTML.Safe

Phoenix.HTML.Safe protocol

Defines the HTML safe protocol.

In order to promote HTML safety, Phoenix templates do not use Kernel.to_string/1 to convert data types to strings in templates. Instead, Phoenix uses this protocol which must be implemented by data structures and guarantee that a HTML safe representation is returned.

Furthermore, this protocol relies on iodata, which provides better performance when sending or streaming data to the client.

Summary

Types

t()

Functions

to_iodata(data)

Types

t()

t() :: term

Functions

to_iodata(data)

© 2014 Chris McCord
Licensed under the MIT License.
https://hexdocs.pm/phoenix_html/Phoenix.HTML.Safe.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部