{"id":19904162,"url":"https://github.com/bertptrs/marty","last_synced_at":"2025-08-04T15:38:22.479Z","repository":{"id":11919134,"uuid":"14485394","full_name":"bertptrs/marty","owner":"bertptrs","description":"Smarty for the Mako php framework","archived":false,"fork":false,"pushed_at":"2022-09-11T15:50:12.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-01T14:56:58.161Z","etag":null,"topics":["mako-framework","smarty"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bertptrs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-18T07:20:50.000Z","updated_at":"2022-08-25T16:44:46.000Z","dependencies_parsed_at":"2022-09-22T14:43:24.607Z","dependency_job_id":null,"html_url":"https://github.com/bertptrs/marty","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/bertptrs/marty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fmarty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fmarty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fmarty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fmarty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertptrs","download_url":"https://codeload.github.com/bertptrs/marty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fmarty/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268716441,"owners_count":24295501,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["mako-framework","smarty"],"created_at":"2024-11-12T20:27:10.376Z","updated_at":"2025-08-04T15:38:22.426Z","avatar_url":"https://github.com/bertptrs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Marty\n\n[![Continuous\nIntegration](https://github.com/bertptrs/marty/actions/workflows/ci.yml/badge.svg)](https://github.com/bertptrs/marty/actions/workflows/ci.yml)\n[![Latest Stable\nVersion](https://poser.pugx.org/bertptrs/marty/v/stable)](https://packagist.org/packages/bertptrs/marty)\n[![Total\nDownloads](https://poser.pugx.org/bertptrs/marty/downloads)](https://packagist.org/packages/bertptrs/marty)\n[![License](https://poser.pugx.org/bertptrs/marty/license)](https://packagist.org/packages/bertptrs/marty)\n\nMarty is a simple Smarty view renderer for the Mako framework.\n\n## Requirements\n\nMarty has been tested on all current Mako versions. Any other version\n_may_ work, but has not been tested. Unit tests are run against PHP 7.0\nand up. Smarty 3 or 4 is required, but will be pulled in as part of the\ninstallation.\n\n## Installation\n\nMarty can be added to your Mako project using composer! Just add it to your\nrequirements\n\n```js\n{\n\t/* Stuff */\n\trequire: {\n\t\t/* Your other requirements */\n\t\t\"bertptrs/marty\": \"*\"\n\t}\n\t/* The rest of your composer.json*/\n}\n```\n\n## Usage\n\nOnce installed, you will need to add it to your packages list. You do\nthis by adding it to the \"Web\" packages. This is located in the file\n`app/config/application.php`.\n\n```php\n\u003c?php\nreturn [\n\t// …\n\t'packages' =\u003e [\n\t\t// …\n\t\t'web' =\u003e [\n\t\t\t'marty\\MartyPackage',\n\t\t],\n\t],\n\t// …\n];\n?\u003e\n```\n\nThis enables the Smarty View renderer for every view with the \".tpl\" file extension.\n\n\n### Configuration\n\nConfiguration can be done by changing the `marty::smarty` configuration.\nJust refer to the [Mako documentation on package\nconfiguration](http://makoframework.com/docs/3.6/getting-started:configuration#cascading_configuration)\nfor details.\n\nThe configuration properties are as follows:\n\n| Configuration property | Type     | Description                                         | Default                                                   |\n| ---------------------- | -------- | --------------------------------------------------- | --------------------------------------------------------- |\n| smarty.templateDir     | string   | The location to find smarty templates.              | Your `app/views` directory.                               |\n| smarty.compileDir      | string   | The location to store compiled templates.           | A new directory `smarty` in your `app/storage` directory. |\n| smarty.pluginDirs      | string[] | A list of directories to search for smarty plugins. | An empty array.                                           |\n\n### Plugins\n\nMarty supports the plugin structure offered by Smarty, and extends it to\nuse the dependency injector offered by the Mako framework.\n\nPlugin dirs can be added to the config. The structure for plugins can be\nfound in the [Smarty Documentation](http://www.smarty.net/docs/en/). Due\nto the fact that Mako resolves parameters by name, Smarty plugin\nparameters should have their names as specified in the documentation.\nThis means that the parameters should be named as follows:\n\n- Template functions:\n    - parameters should be named `$params`\n    - The smarty template should be named `$template`\n- Modifiers:\n    - The input data should be named `$value`\n    - Any other values will be stored in array `$params` in order.\n- Block functions:\n    - Call parameters should be named `$params`\n    - The block content should be named `$content`\n    - The template reference should be named `$template`\n    - The repetition flag should be named `$repeat`.\n- Compiler functions:\n    - Call parameters should be named `$params`\n    - The Smarty reference should be named `$smarty`\n\nAs an example, we can build a small plugin that uses the I18n module of\nthe framework.\n\n```php\n\nfunction smarty_modifier_i18n($value, mako\\i18n\\I18n $i18n) {\n    return $i18n-\u003eget($value);\n}\n```\n\nThen, we can use your plugin like this:\n\n```smarty\nLets show {'some.translated.text'|i18n}.\n```\n\n## Contributing\n\nIf there are any features in Smarty that cannot (easily) be used in the\ncurrent package, or if there are Mako features that are hard to bind to\nSmarty, feel free to file an issue or a pull request.\n\nCode style and such are ran using GrumPHP. Make sure that your files are\nin accordance to those rules.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertptrs%2Fmarty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertptrs%2Fmarty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertptrs%2Fmarty/lists"}