phoenix_html_simplified_helpers alternatives and similar packages
Based on the "Framework Components" category.
Alternatively, view phoenix_html_simplified_helpers alternatives based on common mentions on social networks and blogs.
-
commanded
Use Commanded to build Elixir CQRS/ES applications -
surface
A server-side rendering component library for Phoenix -
ex_admin
ExAdmin is an auto administration package for Elixir and the Phoenix Framework -
phoenix_html
Phoenix.HTML functions for working with HTML strings and templates -
phoenix_ecto
Phoenix and Ecto integration with support for concurrent acceptance testing -
react_phoenix
Make rendering React.js components in Phoenix easy -
absinthe_plug
Plug support for Absinthe, the GraphQL toolkit for Elixir -
corsica
Elixir library for dealing with CORS requests. 🏖 -
scrivener_html
HTML view helpers for Scrivener -
Raxx
Interface for HTTP webservers, frameworks and clients -
phoenix_slime
Phoenix Template Engine for Slime -
phoenix_live_reload
Provides live-reload functionality for Phoenix -
params
Easy parameters validation/casting with Ecto.Schema, akin to Rails' strong parameters. -
phoenix_pubsub_redis
The Redis PubSub adapter for the Phoenix framework -
rummage_ecto
Search, Sort and Pagination for ecto queries -
dayron
A repository `similar` to Ecto.Repo that maps to an underlying http client, sending requests to an external rest api instead of a database -
passport
Provides authentication for phoenix application -
phoenix_token_auth
Token authentication solution for Phoenix. Useful for APIs for e.g. single page apps. -
phoenix_haml
Phoenix Template Engine for Haml -
rummage_phoenix
Full Phoenix Support for Rummage. It can be used for searching, sorting and paginating collections in phoenix. -
recaptcha
A simple reCaptcha 2 library for Elixir applications. -
sentinel
DEPRECATED - Phoenix Authentication library that wraps Guardian for extra functionality -
plug_graphql
Plug (Phoenix) integration for GraphQL Elixir -
plug_rails_cookie_session_store
Rails compatible Plug session store -
phx_component_helpers
Extensible Phoenix liveview components, without boilerplate -
filterable
Filtering from incoming params in Elixir/Ecto/Phoenix with easy to use DSL. -
multiverse
Elixir package that allows to add compatibility layers via API gateways. -
access pass
provides a full user authentication experience for an API. Includes login,logout,register,forgot password, forgot username, confirmation email and all that other good stuff. Includes plug for checking for authenticated users and macro for generating the required routes. -
ashes
A code generation tool for the Phoenix web framework -
better_params
Cleaner request parameters in Elixir web applications 🙌 -
scrivener_headers
Scrivener pagination with headers and web linking -
plug_auth
A collection of authentication-related plugs -
phoenix_pubsub_rabbitmq
RabbitMQ adapter for Phoenix's PubSub layer -
plug_checkup
PlugCheckup provides a Plug for adding simple health checks to your app -
plug_statsd
Send connection response time and count to statsd -
plug_rest
REST behaviour and Plug router for hypermedia web applications in Elixir -
trailing_format_plug
An elixir plug to support legacy APIs that use a rails-like trailing format: http://api.dev/resources.json -
Votex
Implements vote / like / follow functionality for Ecto models in Elixir. Inspired from Acts as Votable gem in Ruby on Rails -
plug_canonical_host
PlugCanonicalHost ensures that all requests are served by a single canonical host.
Learn Elixir in as little as 12 Weeks
Do you think we are missing an alternative of phoenix_html_simplified_helpers or a related project?
README
PhoenixHtmlSimplifiedHelpers
Installation
If available in Hex, the package can be installed as:
- Add phoenix_html_simplified_helpers to your list of dependencies in
mix.exs
:
def deps do
[{:phoenix_html_simplified_helpers, "~> x.x.x"}]
end
- Ensure phoenix_html_simplified_helpers is started before your application:
def application do
[applications: [:phoenix_html_simplified_helpers]]
end
- phoenix_html_simplified_helpers need to import(use) your Phoenix project. The following description is adding 'use syntax' into web.ex.
def view do
quote do
use Phoenix.View, root: "web/templates"
# Import convenience functions from controllers
import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, view_module: 1]
# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML
use Phoenix.HTML.SimplifiedHelpers # <- this line.
import MyApp.Router.Helpers
import MyApp.ErrorHelpers
import MyApp.Gettext
end
end
It is also able to import(use) in each view helper files.
defmodule MyApp.LayoutView do
use MyApp.Web, :view
import Phoenix.HTML.SimplifiedHelpers.Truncate # <- this line.
import Phoenix.HTML.SimplifiedHelpers.TimeAgoInWords # <- this line.
end
- time_ago_in_words has Gettext module that is changed translation file from project's locale.
Gettext.put_locale(Phoenix.HTML.SimplifiedHelpers.Gettext, "en")
Gettext.put_locale(Phoenix.HTML.SimplifiedHelpers.Gettext, "ja")
Gettext.put_locale(Phoenix.HTML.SimplifiedHelpers.Gettext, "es")
Usage
truncate
<%= truncate entity.content %>
truncate "Once upon a time in a world far far away"
# Once upon a time in a world...
truncate "Once upon a time in a world far far away", length: 27
# Once upon a time in a wo...
truncate "And they found that many people were sleeping better.", length: 25, omission: "... (continued)"
# And they f... (continued)
truncate("Once upon a time in a world far far away", length: 17, separator: " ")
# Once upon a...
time_ago_in_words
<%= time_ago_in_words entity.published_at %> ago
time_ago_in_words :os.system_time
# less than 5 seconds
time_ago_in_words Timex.now
# less than 5 seconds
time_ago_in_words DateTime.utc_now
# less than 5 seconds
time_ago_in_words Ecto.DateTime.utc
# less than 5 seconds
time_ago_in_words NaiveDateTime.utc_now
# less than 5 seconds
time_ago_in_words ~N[2017-08-14 04:40:12.101212]
# ......
distance_of_time_in_words
from = Timex.to_datetime({{2015, 10, 31}, {0, 0, 0}})
to = Timex.shift(from, days: 45)
distance_of_time_in_words(from, to)
# about 2 months
Gettext.put_locale(Phoenix.HTML.SimplifiedHelpers.Gettext, "ja")
from = Timex.to_datetime({{2015, 10, 31}, {0, 0, 0}})
to = Timex.shift(from, months: 1)
distance_of_time_in_words(from, to)
# 約1ヶ月
Gettext.put_locale(Phoenix.HTML.SimplifiedHelpers.Gettext, "es")
from = Timex.to_datetime({{2015, 10, 31}, {0, 0, 0}})
to = Timex.shift(from, months: 18)
distance_of_time_in_words(from, to)
# más de 1 año
Or uses Timex.format!("{relative}", :relative)
instead, like this.
Timex.shift(datetime, hours: -3) |> Timex.format!("{relative}", :relative)
"3 hours ago"
number_with_delimiter
number_with_delimiter 1234567
# 1,234,567
url_for
Routes setting is Here.
url_for(conn, "home.index")
# /
url_for(conn, "entry.release:")
# /release/
url_for(conn, "entry.release:percent")
# /release/percent
url_for(conn, "entry.release:", some: "query")
# /release/?some=query
url_for(conn, "entry.release:", some: "query", unko: "query2")
# /release/?some=query&unko=query2
current_page?
conn = conn(:get, "/release/")
current_page?(conn, "entry.release:")
# true
current_page?(conn, "home.index")
# false
*Note that all licence references and agreements mentioned in the phoenix_html_simplified_helpers README section above
are relevant to that project's source code only.