I'm continue to develop Weber, who don't know what is it Weber, can knows from previous posts that Weber is a Rails-like web framework written with Elixir programming language. Some times ago i released Weber with version - 0.0.2
Weber controllers now have many different response types:
There are some new features in routing too... First of all you can declare route as Controller#action, for example:
Now you can pass any parameters to the URL query string and get it's values with the Weber.Http.Params.param/1 function. For example you got request for: /user?name=0xAX, you can get name parameter's value like this:
Html helpers gives you opportunity to generate html templates from elixir:
Include view helper helps to include other views inside another.
You can include your static resources like javascript, css, favicon or image files with resource helpers:
If you will get Weber from master branch, there is sessions support there and simple API for managing sessions:
And the latest good news in this post, we have a logo:
thank you @caiotarifa for this great work.
Yes, Weber now has many new features as Sessions API, Helpers, Json encoding/decoding and etc... We waiting new contributors, you can help Weber to grow via submiting pull request (If you're interesting - Weber Roadmap, help us with translation onto your language (I18n In development), or just set up star at github. . If you will have any questsions/bug reports/suggestions write us to the issues or join to the #WeberMVC at irc.freenode.net.
and now it has many new features. Let's see what we have now.Just released #rails like framework for #ElixirLang - Weber-0.0.2 https://t.co/AFCXYkswAH @elixirlang #Elixir #Erlang #Web
— 0xAX (@0xAX) October 6, 2013
Controllers
Weber controllers now have many different response types:
- {:render, [project: "simpleTodo"], [{"HttpHeaderName", "HttpHeaderValheaderVal"}]} - Render views with the same name as controller and sends it to response.
- {:render_inline, "foo <%= bar %>", [bar: "baz"]}, []} - Render inline template.
- {:file, path, headers} - Send file in response.
- {:json, [response: "ok"], [{"HttpHeaderName", "HttpHeaderValheaderVal"}]} - Weber convert keyword to json and sends it to response.
- {:redirect, "/main"} - Redirect to other resource.
- {:text, data, headers} - Sends plain text.
- {:nothing, ["Cache-Control", "no-cache"]} - Sends empty response with status 200 and headers.
Routing
There are some new features in routing too... First of all you can declare route as Controller#action, for example:
Now you can pass any parameters to the URL query string and get it's values with the Weber.Http.Params.param/1 function. For example you got request for: /user?name=0xAX, you can get name parameter's value like this:
Helpers
Html Helper
Html helpers gives you opportunity to generate html templates from elixir:
Include view helper
Include view helper helps to include other views inside another.
Resource Helpers
You can include your static resources like javascript, css, favicon or image files with resource helpers:
Session API
If you will get Weber from master branch, there is sessions support there and simple API for managing sessions:
- get_session() -> [] | [{atom, binary()}]
- get_session(key :: atom()) -> [] | binary()
- set_session_val(key :: atom(), val :: binary()) -> :ok
Logo
And the latest good news in this post, we have a logo:
thank you @caiotarifa for this great work.
Conclusion
Yes, Weber now has many new features as Sessions API, Helpers, Json encoding/decoding and etc... We waiting new contributors, you can help Weber to grow via submiting pull request (If you're interesting - Weber Roadmap, help us with translation onto your language (I18n In development), or just set up star at github. . If you will have any questsions/bug reports/suggestions write us to the issues or join to the #WeberMVC at irc.freenode.net.
Comments