{"id":16834735,"url":"https://github.com/jaxon-php/jaxon-yii","last_synced_at":"2026-01-30T05:04:11.174Z","repository":{"id":50617485,"uuid":"60751898","full_name":"jaxon-php/jaxon-yii","owner":"jaxon-php","description":"Jaxon library integration for the Yii framework https://www.jaxon-php.org.","archived":false,"fork":false,"pushed_at":"2024-11-15T19:50:18.000Z","size":64,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T02:43:33.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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":"2016-06-09T05:28:38.000Z","updated_at":"2024-11-15T19:50:22.000Z","dependencies_parsed_at":"2025-02-18T18:35:20.337Z","dependency_job_id":"a040d3a6-8571-44ec-a504-998d198ba1aa","html_url":"https://github.com/jaxon-php/jaxon-yii","commit_stats":{"total_commits":82,"total_committers":1,"mean_commits":82.0,"dds":0.0,"last_synced_commit":"7afa2a4eb23e3e30cddf745bba90835509f2aa81"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-yii","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-yii/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-yii/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-yii/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaxon-php","download_url":"https://codeload.github.com/jaxon-php/jaxon-yii/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247941702,"owners_count":21022038,"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-10-13T12:07:39.846Z","updated_at":"2026-01-30T05:04:11.161Z","avatar_url":"https://github.com/jaxon-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Jaxon integration for the Yii framework\n=======================================\n\nThis package integrates the [Jaxon library](https://github.com/jaxon-php/jaxon-core) into the Yii framework.\nIt requires the version 2.0.11 or newer.\n\nInstallation\n------------\n\nAdd the following lines in the `composer.json` file, and run the `composer update` command.\n\n```json\n\"require\": {\n    \"jaxon-php/jaxon-yii\": \"^4.0\"\n}\n```\n\nOr run the `composer require jaxon-php/jaxon-yii` command.\n\nThis package provides a filter that must be attached to routes to pages where the Jaxon features are enabled.\n\nThis is an example of a Yii controller using the Jaxon library.\n\n```php\nnamespace app\\controllers;\n\nuse Yii;\nuse yii\\web\\Controller;\nuse Jaxon\\Yii\\Filter\\JaxonConfigFilter;\n\nclass DemoController extends Controller\n{\n    public function behaviors()\n    {\n        return [\n            [\n                'class' =\u003e JaxonConfigFilter::class,\n                'only' =\u003e ['index', 'jaxon'],\n            ],\n        ];\n    }\n\n    /**\n     * Process Jaxon ajax requests. This route must be the same that is set in the Jaxon config.\n     */\n    public function actionJaxon()\n    {\n        $jaxon = jaxon()-\u003eapp();\n        if(!$jaxon-\u003ecanProcessRequest())\n        {\n            // Jaxon failed to find a plugin to process the request\n            return; // Todo: return an error message\n        }\n\n        return $jaxon-\u003eprocessRequest();\n    }\n\n    /**\n     * Insert Jaxon js and css codes in the page.\n     */\n    public function actionIndex()\n    {\n        // Set the layout\n        $this-\u003elayout = 'demo';\n        // Get the Jaxon module\n        $jaxon = jaxon()-\u003eapp();\n\n        return $this-\u003erender('index', [\n            'jaxonCss' =\u003e $jaxon-\u003ecss(),\n            'jaxonJs' =\u003e $jaxon-\u003ejs(),\n            'jaxonScript' =\u003e $jaxon-\u003escript()\n        ]);\n    }\n}\n```\n\nBefore it prints the page, the controller calls the `$jaxon-\u003ecss()`, `$jaxon-\u003ejs()` and `$jaxon-\u003escript()` functions,\nto get the CSS and javascript codes generated by Jaxon which are inserted into the page.\n\nConfiguration\n------------\n\nThe Jaxon library settings are defined in the `@app/config/jaxon.php` file, and separated into two sections.\nThe options in the `lib` section are those of the Jaxon core library, while the options in the `app` sections are those of the Jaxon application.\n\nThe following options can be defined in the `app` section of the config file.\n\n| Name | Description |\n|------|---------------|\n| directories | An array of directory containing Jaxon application classes |\n| views   | An array of directory containing Jaxon application views |\n| | | |\n\nBy default, the `views` array is empty. Views are rendered from the framework default location.\nThere's a single entry in the `directories` array with the following values.\n\n| Name | Default value | Description |\n|------|---------------|-------------|\n| directory | @app/jaxon/classes  | The directory of the Jaxon classes |\n| namespace | \\Jaxon\\App  | The namespace of the Jaxon classes |\n| separator | .           | The separator in Jaxon class names |\n| protected | empty array | Prevent Jaxon from exporting some methods |\n| | | |\n\nUsage\n-----\n\n### The Jaxon classes\n\nThe Jaxon classes can inherit from `\\Jaxon\\App\\CallableClass`.\nBy default, they are located in the `@app/jaxon/ajax` dir of the Yii application, and the associated namespace is `\\Jaxon\\Ajax`.\n\nThis is an example of a Jaxon class, defined in the `@app/jaxon/ajax/HelloWorld.php` file.\n\n```php\nnamespace Jaxon\\Ajax;\n\nclass HelloWorld extends \\Jaxon\\App\\CallableClass\n{\n    public function sayHello()\n    {\n        $this-\u003eresponse-\u003eassign('div2', 'innerHTML', 'Hello World!');\n    }\n}\n```\n\nContribute\n----------\n\n- Issue Tracker: github.com/jaxon-php/jaxon-yii/issues\n- Source Code: github.com/jaxon-php/jaxon-yii\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-yii","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaxon-php%2Fjaxon-yii","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxon-php%2Fjaxon-yii/lists"}