Underlying Elixir
> is the pipe operator, pipe segments on the left pass the value as an argument to functions on the right. Together pipe segments compose the pipeline. |
Layers of Phoenix
connection
|> endpoint
|> router
|> pipelines
|> controllers
Common services are implemented using Plug, persistence layer is managed in Ecto. Ecto helps seperate actions that is transforming data from code that interacts with the outside world.
Highlight block
def inc(x), do: x + 1
alert( 'Hello, world!' );
print 'helloworld'
def foo
puts 'foo'
end
1
2
3
def foo
puts 'foo'
end
#include <iostream>
using namespace std;
void foo(int arg1, int arg2)
{
}
int main()
{
string str;
foo(1, 2);
cout << "Hello World" << endl;
return 0;
}