{"id":20934459,"url":"https://github.com/jaxon-php/jaxon-latte","last_synced_at":"2025-10-12T12:50:06.583Z","repository":{"id":56816185,"uuid":"90537303","full_name":"jaxon-php/jaxon-latte","owner":"jaxon-php","description":"Jaxon view renderer for Latte templates","archived":false,"fork":false,"pushed_at":"2024-12-14T00:14:31.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T07:41:27.007Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaxon-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-05-07T14:11:28.000Z","updated_at":"2024-12-14T00:14:35.000Z","dependencies_parsed_at":"2024-06-17T18:13:14.645Z","dependency_job_id":"de7e14cc-1271-4c76-ad6f-bb0ba43c6a47","html_url":"https://github.com/jaxon-php/jaxon-latte","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"563feb80832da94d6c748f757fe307d05d11b62a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-latte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-latte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-latte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-latte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaxon-php","download_url":"https://codeload.github.com/jaxon-php/jaxon-latte/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020903,"owners_count":22000806,"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":[],"created_at":"2024-11-18T22:09:26.665Z","updated_at":"2025-10-12T12:50:06.577Z","avatar_url":"https://github.com/jaxon-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Jaxon View for Latte\n====================\n\nRender views with the [Latte template engine](https://latte.nette.org/) in Jaxon applications.\n\nInstallation\n------------\n\nInstall this package with Composer.\n\n```json\n\"require\": {\n    \"jaxon-php/jaxon-latte\": \"^5.0\"\n}\n```\n\nUsage\n-----\n\nFor each directory containing Latte templates, add an entry to the `app.views` section in the configuration.\n\n```php\n    'app' =\u003e [\n        'views' =\u003e [\n            'demo' =\u003e [\n                'directory' =\u003e '/path/to/demo/views',\n                'extension' =\u003e '.latte',\n                'renderer' =\u003e 'latte',\n            ],\n        ],\n    ],\n```\n\nIn the following example, the DOM element with id `content-id` is assigned the value of the `/path/to/demo/views/sub/dir/file.latte` template.\n\n```php\nclass MyClass extends \\Jaxon\\App\\FuncComponent\n{\n    public function action()\n    {\n        $this-\u003eresponse-\u003ehtml('content-id', $this-\u003eview()-\u003erender('demo::/sub/dir/file'));\n    }\n}\n```\n\nTemplate functions\n------------------\n\nThis extension provides the following template functions to insert Jaxon js and css codes in the pages that need to show Jaxon related content.\n\n```php\n// /path/to/demo/views/sub/dir/file.latte\n\n\u003c!-- In page header --\u003e\n{jxnCss()}\n\u003c/head\u003e\n\n\u003cbody\u003e\n\n\u003c!-- Page content here --\u003e\n\n\u003c/body\u003e\n\n\u003c!-- In page footer --\u003e\n{jxnJs()}\n\n{jxnScript()}\n```\n\nCall factories\n--------------\n\nThis extension registers the following template functions for Jaxon [call factories](https://www.jaxon-php.org/docs/v5x/ui-features/call-factories.html).\n\n\u003e [!NOTE]\n\u003e In the following examples, the `$rqAppTest` template variable is set to the value `rq(Demo\\Ajax\\App\\AppTest::class)`.\n\nThe `jxnBind` function attaches a UI component to a DOM element, while the `jxnHtml` function displays a component HTML code in a view.\n\n```php\n    \u003cdiv class=\"col-md-12\" {jxnBind($rqAppTest)}\u003e\n        {jxnHtml($rqAppTest)}\n    \u003c/div\u003e\n```\n\nThe `jxnPagination` function displays pagination links in a view.\n\n```php\n    \u003cdiv class=\"col-md-12\" {jxnPagination($rqAppTest)}\u003e\n    \u003c/div\u003e\n```\n\nThe `jxnOn` function binds an event on a DOM element to a Javascript call defined with a `call factory`.\n\n```php\n    \u003cselect class=\"form-select\"\n        {jxnOn('change', $rqAppTest-\u003esetColor(jq().val()))}\u003e\n        \u003coption value=\"black\" selected=\"selected\"\u003eBlack\u003c/option\u003e\n        \u003coption value=\"red\"\u003eRed\u003c/option\u003e\n        \u003coption value=\"green\"\u003eGreen\u003c/option\u003e\n        \u003coption value=\"blue\"\u003eBlue\u003c/option\u003e\n    \u003c/select\u003e\n```\n\nThe `jxnClick` function is a shortcut to define a handler for the `click` event.\n\n```php\n    \u003cbutton type=\"button\" class=\"btn btn-primary\"\n        {jxnClick($rqAppTest-\u003esayHello(true))}\u003eClick me\u003c/button\u003e\n```\n\nThe `jxnEvent` function defines a set of events handlers on the children of a DOM element, using `jQuery` selectors.\n\n```php\n    \u003cdiv class=\"row\" {jxnEvent([\n        ['.app-color-choice', 'change', $rqAppTest-\u003esetColor(jq().val())]\n        ['.ext-color-choice', 'change', $rqExtTest-\u003esetColor(jq().val())]\n    ])}\u003e\n        \u003cdiv class=\"col-md-12\"\u003e\n            \u003cselect class=\"form-control app-color-choice\"\u003e\n                \u003coption value=\"black\" selected=\"selected\"\u003eBlack\u003c/option\u003e\n                \u003coption value=\"red\"\u003eRed\u003c/option\u003e\n                \u003coption value=\"green\"\u003eGreen\u003c/option\u003e\n                \u003coption value=\"blue\"\u003eBlue\u003c/option\u003e\n            \u003c/select\u003e\n        \u003c/div\u003e\n        \u003cdiv class=\"col-md-12\"\u003e\n            \u003cselect class=\"form-control ext-color-choice\"\u003e\n                \u003coption value=\"black\" selected=\"selected\"\u003eBlack\u003c/option\u003e\n                \u003coption value=\"red\"\u003eRed\u003c/option\u003e\n                \u003coption value=\"green\"\u003eGreen\u003c/option\u003e\n                \u003coption value=\"blue\"\u003eBlue\u003c/option\u003e\n            \u003c/select\u003e\n        \u003c/div\u003e\n    \u003c/div\u003e\n```\n\nThe `jxnEvent` function takes as parameter an array in which each entry is an array with a `jQuery` selector, an event and a `call factory`.\n\nContribute\n----------\n\n- Issue Tracker: github.com/jaxon-php/jaxon-latte/issues\n- Source Code: github.com/jaxon-php/jaxon-latte\n\nLicense\n-------\n\nThe package is licensed under the BSD license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxon-php%2Fjaxon-latte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaxon-php%2Fjaxon-latte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxon-php%2Fjaxon-latte/lists"}