{"id":20934473,"url":"https://github.com/jaxon-php/jaxon-smarty","last_synced_at":"2026-04-25T00:37:53.602Z","repository":{"id":56997052,"uuid":"90319407","full_name":"jaxon-php/jaxon-smarty","owner":"jaxon-php","description":"Jaxon view renderer for Smarty templates","archived":false,"fork":false,"pushed_at":"2025-07-23T15:27:25.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T16:45:40.235Z","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-04T23:49:42.000Z","updated_at":"2025-07-23T15:27:29.000Z","dependencies_parsed_at":"2025-01-19T19:47:55.515Z","dependency_job_id":null,"html_url":"https://github.com/jaxon-php/jaxon-smarty","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"8417499d3f8afb12403fe66f720f3b41776f6e58"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jaxon-php/jaxon-smarty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-smarty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-smarty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-smarty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-smarty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaxon-php","download_url":"https://codeload.github.com/jaxon-php/jaxon-smarty/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-smarty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32246396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: 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-18T22:09:29.619Z","updated_at":"2026-04-25T00:37:53.582Z","avatar_url":"https://github.com/jaxon-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Jaxon View for Smarty\r\n=====================\r\n\r\nRender Smarty templates in Jaxon applications.\r\n\r\nInstallation\r\n------------\r\n\r\nInstall this package with Composer.\r\n\r\n```json\r\n\"require\": {\r\n    \"jaxon-php/jaxon-smarty\": \"^5.0\"\r\n}\r\n```\r\n\r\nUsage\r\n-----\r\n\r\nFor each directory containing Smarty templates, add an entry to the `app.views` section in the configuration.\r\n\r\n```php\r\n    'app' =\u003e [\r\n        'views' =\u003e [\r\n            'demo' =\u003e [\r\n                'directory' =\u003e '/path/to/demo/views',\r\n                'extension' =\u003e '.tpl',\r\n                'renderer' =\u003e 'smarty',\r\n            ],\r\n        ],\r\n    ],\r\n```\r\n\r\nIn the following example, the DOM element with id `content-id` is assigned the value of the `/path/to/demo/views/sub/dir/file.tpl` template.\r\n\r\n```php\r\nclass MyClass extends \\Jaxon\\App\\FuncComponent\r\n{\r\n    public function action()\r\n    {\r\n        $this-\u003eresponse-\u003ehtml('content-id', $this-\u003eview()-\u003erender('demo::/sub/dir/file'));\r\n    }\r\n}\r\n```\r\n\r\nTwig functions\r\n--------------\r\n\r\nThis extension provides the following Twig functions to insert Jaxon js and css codes in the pages that need to show Jaxon related content.\r\n\r\n```php\r\n// /path/to/demo/views/sub/dir/file.tpl\r\n\r\n\u003c!-- In page header --\u003e\r\n{jxnCss}\r\n\u003c/head\u003e\r\n\r\n\u003cbody\u003e\r\n\r\n\u003c!-- Page content here --\u003e\r\n\r\n\u003c/body\u003e\r\n\r\n\u003c!-- In page footer --\u003e\r\n{jxnJs}\r\n\r\n{jxnScript}\r\n```\r\n\r\nCall factories\r\n--------------\r\n\r\nThis extension registers the following Twig functions for Jaxon [call factories](https://www.jaxon-php.org/docs/v5x/ui-features/call-factories.html) functions.\r\n\r\n\u003e [!NOTE]\r\n\u003e In the following examples, the `rqAppTest` template variable is set to the value `rq(Demo\\Ajax\\App\\AppTest::class)`.\r\n\r\nThe `jxnBind` function attaches a UI component to a DOM element, while the `jxnHtml` function displays a component HTML code in a view.\r\n\r\n```php\r\n    \u003cdiv class=\"col-md-12\" {jxnBind comp=$rqAppTest}\u003e\r\n        {jxnHtml comp=$rqAppTest}\r\n    \u003c/div\u003e\r\n```\r\n\r\nThe `jxnPagination` function displays pagination links in a view.\r\n\r\n```php\r\n    \u003cdiv class=\"col-md-12\" {jxnPagination comp=$rqAppTest}\u003e\r\n    \u003c/div\u003e\r\n```\r\n\r\nThe `jxnOn` function binds an event on a DOM element to a Javascript call defined with a `call factory`.\r\n\r\n```php\r\n    \u003cselect class=\"form-select\"\r\n        {jxnOn event=change call=$rqAppTest-\u003esetColor(jq()-\u003eval())}\u003e\r\n        \u003coption value=\"black\" selected=\"selected\"\u003eBlack\u003c/option\u003e\r\n        \u003coption value=\"red\"\u003eRed\u003c/option\u003e\r\n        \u003coption value=\"green\"\u003eGreen\u003c/option\u003e\r\n        \u003coption value=\"blue\"\u003eBlue\u003c/option\u003e\r\n    \u003c/select\u003e\r\n```\r\n\r\nThe `jxnClick` function is a shortcut to define a handler for the `click` event.\r\n\r\n```php\r\n    \u003cbutton type=\"button\" class=\"btn btn-primary\"\r\n        {jxnClick call=$rqAppTest-\u003esayHello(true)}\u003eClick me\u003c/button\u003e\r\n```\r\n\r\nThe `jxnEvent` function defines a set of events handlers on the children of a DOM element, using `jQuery` selectors.\r\n\r\n```php\r\n    \u003cdiv class=\"row\" {jxnEvent events=[\r\n        ['.app-color-choice', 'change', $rqAppTest-\u003esetColor(jq()-\u003eval())]\r\n        ['.ext-color-choice', 'change', $rqExtTest-\u003esetColor(jq()-\u003eval())]\r\n    ]}\u003e\r\n        \u003cdiv class=\"col-md-12\"\u003e\r\n            \u003cselect class=\"form-control app-color-choice\"\u003e\r\n                \u003coption value=\"black\" selected=\"selected\"\u003eBlack\u003c/option\u003e\r\n                \u003coption value=\"red\"\u003eRed\u003c/option\u003e\r\n                \u003coption value=\"green\"\u003eGreen\u003c/option\u003e\r\n                \u003coption value=\"blue\"\u003eBlue\u003c/option\u003e\r\n            \u003c/select\u003e\r\n        \u003c/div\u003e\r\n        \u003cdiv class=\"col-md-12\"\u003e\r\n            \u003cselect class=\"form-control ext-color-choice\"\u003e\r\n                \u003coption value=\"black\" selected=\"selected\"\u003eBlack\u003c/option\u003e\r\n                \u003coption value=\"red\"\u003eRed\u003c/option\u003e\r\n                \u003coption value=\"green\"\u003eGreen\u003c/option\u003e\r\n                \u003coption value=\"blue\"\u003eBlue\u003c/option\u003e\r\n            \u003c/select\u003e\r\n        \u003c/div\u003e\r\n    \u003c/div\u003e\r\n```\r\n\r\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`.\r\n\r\nContribute\r\n----------\r\n\r\n- Issue Tracker: github.com/jaxon-php/jaxon-smarty/issues\r\n- Source Code: github.com/jaxon-php/jaxon-smarty\r\n\r\nLicense\r\n-------\r\n\r\nThe package is licensed under the BSD license.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxon-php%2Fjaxon-smarty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaxon-php%2Fjaxon-smarty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxon-php%2Fjaxon-smarty/lists"}