{"id":19165086,"url":"https://github.com/bragful/ephp_template","last_synced_at":"2025-06-25T12:36:38.540Z","repository":{"id":57495604,"uuid":"173329561","full_name":"bragful/ephp_template","owner":"bragful","description":"PHP Template for Phoenix Framework","archived":false,"fork":false,"pushed_at":"2019-10-26T00:31:17.000Z","size":17,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-10T11:59:08.142Z","etag":null,"topics":["bragful","ephp","phoenix-framework","php"],"latest_commit_sha":null,"homepage":"https://bragful.com","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bragful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["manuel-rubio"],"patreon":"altenwald","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-03-01T15:58:38.000Z","updated_at":"2023-02-19T22:53:03.000Z","dependencies_parsed_at":"2022-08-28T19:51:02.534Z","dependency_job_id":null,"html_url":"https://github.com/bragful/ephp_template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bragful/ephp_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bragful%2Fephp_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bragful%2Fephp_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bragful%2Fephp_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bragful%2Fephp_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bragful","download_url":"https://codeload.github.com/bragful/ephp_template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bragful%2Fephp_template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261875386,"owners_count":23223323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bragful","ephp","phoenix-framework","php"],"created_at":"2024-11-09T09:26:27.011Z","updated_at":"2025-06-25T12:36:38.515Z","avatar_url":"https://github.com/bragful.png","language":"Elixir","funding_links":["https://github.com/sponsors/manuel-rubio","https://patreon.com/altenwald","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=CBYJ5V2ZWWZ8G"],"categories":[],"sub_categories":[],"readme":"# ephp template\n\n[![License: LGPL 2.1](https://img.shields.io/github/license/bragful/ephp_template.svg)](https://raw.githubusercontent.com/bragful/ephp_template/master/COPYING)\n[![Gitter](https://img.shields.io/gitter/room/bragful/ephp.svg)](https://gitter.im/bragful/ephp)\n[![Hex](https://img.shields.io/hexpm/v/ephp_template.svg)](https://hex.pm/packages/ephp_template)\n\nThis is a template system to let you to use PHP templates inside of [Phoenix Framework](https://phoenixframework.org/).\n\n## Installation\n\nThe package can be installed by adding `ephp_template` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ephp_template, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nIn addition to this you can add to the configuration file:\n\n```elixir\nconfig :phoenix, :template_engines,\n    php: Ephp.Template\n```\n\nThis way you can create PHP files inside of the template directories and use them in the same way as `.html.eex` files.\n\n## Assigns\n\nUsually from the controllers you can send data to the templates (and views). PHP cannot use the specific functions defined by Phoenix Framework but you can use all of the PHP functions available by default by the [ephp](https://github.com/bragful/ephp) project.\n\nThe assigns will be included as normal variables inside of PHP. For example, using this controller:\n\n```elixir\ndefmodule PhptestWeb.PageController do\n  use PhptestWeb, :controller\n\n  def index(conn, _params) do\n    render conn, \"index.html\",\n           user: \"admin\",\n           data: [%{\"a\" =\u003e 10, \"b\" =\u003e 20}, %{\"a\" =\u003e 11, \"b\" =\u003e 21}]\n  end\nend\n```\n\nYou'll have access to `$user` and `$data` variables in the template. You can create the file `index.html.php` and then do whatever you need.\n\n## Superglobals\n\nMaybe it's not needed but you have populated `$_SERVER` (not completely), `$_REQUEST` (and `$_GET` and `$_POST` as well), `$_ENV` and `$_COOKIE`.\n\n## Donation\n\nIf you want to support the project to advance faster with the development you can make a donation. Thanks!\n\n[![paypal](https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=CBYJ5V2ZWWZ8G)\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbragful%2Fephp_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbragful%2Fephp_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbragful%2Fephp_template/lists"}