{"id":18696151,"url":"https://github.com/defstudio/template-processor","last_synced_at":"2026-01-21T01:33:01.093Z","repository":{"id":44537344,"uuid":"340108491","full_name":"defstudio/template-processor","owner":"defstudio","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-18T12:15:37.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-27T09:56:04.167Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defstudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-18T16:24:29.000Z","updated_at":"2024-06-18T12:15:34.000Z","dependencies_parsed_at":"2023-12-12T11:41:18.531Z","dependency_job_id":"b8a9ac27-9874-42e2-9dd3-ac7168ca4be9","html_url":"https://github.com/defstudio/template-processor","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":0.07499999999999996,"last_synced_commit":"c16ac5c0bb315f50e442731338c50c95a0ff04ae"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/defstudio/template-processor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Ftemplate-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Ftemplate-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Ftemplate-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Ftemplate-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defstudio","download_url":"https://codeload.github.com/defstudio/template-processor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defstudio%2Ftemplate-processor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28621660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"ssl_error","status_checked_at":"2026-01-20T23:47:29.996Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-07T11:17:22.073Z","updated_at":"2026-01-21T01:33:01.078Z","avatar_url":"https://github.com/defstudio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"### lowriter installation on docker\n\n```dockerfile\nARG ENABLE_LIBREOFFICE_WRITER=0\nRUN if [ ${ENABLE_LIBREOFFICE_WRITER} = 1 ] ; then \\\n    mkdir -p /usr/share/man/man1 \\\n    \u0026\u0026 mkdir -p /.cache/dconf \u0026\u0026 chmod -R 777 /.cache/dconf \\\n    \u0026\u0026 apt-get update \\\n    \u0026\u0026 apt-get install -y --no-install-recommends openjdk-11-jre-headless \\\n    \u0026\u0026 apt-get install -y --no-install-recommends libreoffice-writer \\\n    \u0026\u0026 apt-get install -y --no-install-recommends libreoffice-java-common ;\\\nfi;\n```\n\n### Usage\n\n```php\nuse DefStudio\\TemplateProcessor\\Elements\\Image;Template::from($dock_template_path)\n        -\u003ecompile([\n            // will replace all instances of ${single_key} with BAR\n            'single_key' =\u003e 'BAR', \n            \n            // and will repeat the block enclosed by ${array_key}[...]${/array_key}\n            'array_key' =\u003e [\n                ['name' =\u003e 'paul', 'age' =\u003e '36'],  // with the name and age of each element of the array\n                ['name' =\u003e 'john', 'age' =\u003e '24'],  \n                ['name' =\u003e 'ringo', 'age' =\u003e '48'],\n                ['name' =\u003e 'george', 'age' =\u003e '22']\n            ],\n            \n            // will replace an image named ${signature} with the one passed as argument\n            // you can set the image name with [right click on image]→properties→options→Name\n            'signature' =\u003e new Image(path: '/var/www/storage/app/signature.png', keep_ratio: true)) \n        ])  \n        \n        // Each action can be done as a standalone call\n        -\u003eset('single_key', 'Bar')\n        -\u003eclone(block_name: 'users', variable_replacements: [\n            ['name' =\u003e 'paul', 'age' =\u003e '36'],\n            ['name' =\u003e 'ringo', 'age' =\u003e '48'],\n            ['name' =\u003e 'george', 'age' =\u003e '22'],\n        ])\n        -\u003einsert_image('signature', new Image(path: '/var/www/storage/app/signature.png', keep_ratio: true))\n        \n        //add -\u003eto_pdf() to convert to .pdf, otherwise an .odt file will be built\n        -\u003eto_pdf() \n        \n        // stores the document in a file\n        -\u003estore($output_file)\n        \n        // or returns a BinaryFileResponse\n        -\u003edownload($dowloaded_file_name)\n```\n\n\n\n### notes\n\n- template processor tries to cleanup its variables/block identifiers, if it is failing the detection, make sure to select and apply \"cancel formatting\" to them \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefstudio%2Ftemplate-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefstudio%2Ftemplate-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefstudio%2Ftemplate-processor/lists"}