{"id":20934464,"url":"https://github.com/jaxon-php/jaxon-cake","last_synced_at":"2026-02-05T09:38:49.669Z","repository":{"id":50616985,"uuid":"77564238","full_name":"jaxon-php/jaxon-cake","owner":"jaxon-php","description":"Jaxon library integration for the CakePHP framework 3 https://www.jaxon-php.org.","archived":false,"fork":false,"pushed_at":"2024-11-15T19:35:15.000Z","size":72,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-15T20:28:26.462Z","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-12-28T22:07:34.000Z","updated_at":"2024-11-15T19:35:19.000Z","dependencies_parsed_at":"2024-07-13T09:20:45.620Z","dependency_job_id":"b3970719-a0af-4f48-a926-3445760ef2f3","html_url":"https://github.com/jaxon-php/jaxon-cake","commit_stats":{"total_commits":65,"total_committers":1,"mean_commits":65.0,"dds":0.0,"last_synced_commit":"d13f26df5492c93a9e6b1bbc874e5dc2e79ba0dc"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-cake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-cake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-cake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxon-php%2Fjaxon-cake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaxon-php","download_url":"https://codeload.github.com/jaxon-php/jaxon-cake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225258935,"owners_count":17445834,"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:27.356Z","updated_at":"2026-02-05T09:38:49.662Z","avatar_url":"https://github.com/jaxon-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Jaxon Library for CakePHP\n=========================\n\nThis package integrates the [Jaxon library](https://github.com/jaxon-php/jaxon-core) into the CakePHP framework.\n\nInstallation\n------------\n\nThe version 4 of the package requires CakePHP version 4.\n\nInstall the package with `Composer`.\n\n```bash\ncomposer require jaxon-php/jaxon-cake ^5.0\n```\nOr\n```json\n{\n    \"require\": {\n        \"jaxon-php/jaxon-cake\": \"^5.0\",\n    }\n}\n```\nAnd run `composer install`.\n\nLoad the Jaxon plugin in the `src/Application.php` file.\n\n```php\n    /**\n     * Load all the application configuration and bootstrap logic.\n     *\n     * @return void\n     */\n    public function bootstrap(): void\n    {\n        ...\n\n        // Load more plugins here\n        $this-\u003eaddPlugin(\\Jaxon\\Cake\\JaxonPlugin::class, ['routes' =\u003e true]);\n    }\n```\n\nLoad the Jaxon view helper in the `src\\View\\AppView.php` file.\n\n```php\n    /**\n     * Initialization hook method.\n     *\n     * Use this method to add common initialization code like loading helpers.\n     *\n     * e.g. `$this-\u003eloadHelper('Html');`\n     *\n     * @return void\n     */\n    public function initialize(): void\n    {\n        $this-\u003eloadHelper('Jaxon/Cake.Jaxon');\n    }\n```\n\nRouting and middlewares\n-----------------------\n\nThis package provides two middlewares, one to load the Jaxon config, and the other to process Jaxon requests.\nThe Jaxon config middleware must be attached to the routes to all the pages where the Jaxon features are enabled,\nwhile the later must be attached to the controller action that processes Jaxon requests.\n\n```php\nuse Jaxon\\Cake\\Middleware\\ConfigMiddleware as JaxonConfigMiddleware;\n\n$routes-\u003escope('/', function (RouteBuilder $builder) {\n    // Register Jaxon middlewares\n    $builder-\u003eregisterMiddleware('jaxon.config', new JaxonConfigMiddleware());\n\n    // Apply the \"jaxon.config\" middleware to routes to pages that require Jaxon.\n    $builder-\u003eapplyMiddleware('jaxon.config');\n\n    ...\n});\n\n```\n\nUsage\n-----\n\nThe settings in the `config/jaxon.php` config file are 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 CakePHP 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 | ROOT . '/jaxon/App' | 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 javascript and CSS code\n\nThe Jaxon view helper provides functions to insert the Jaxon javascript and CSS code into a page.\n\n```php\n\u003c!-- The Jaxon CSS code --\u003e\n\u003c?= $this-\u003eJaxon-\u003ecss() ?\u003e\n```\n\n```php\n\u003c!-- The Jaxon javascript includes --\u003e\n\u003c?= $this-\u003eJaxon-\u003ejs() ?\u003e\n```\n\n```php\n\u003c!-- The Jaxon javascript code --\u003e\n\u003c?= $this-\u003eJaxon-\u003escript() ?\u003e\n```\n\n### The Jaxon classes\n\nThe Jaxon classes can inherit from `\\Jaxon\\App\\CallableClass`.\nBy default, they are located in the `ROOT/jaxon/App` dir of the CakePHP application, and the associated namespace is `\\Jaxon\\App`.\n\nThis is an example of a Jaxon class, defined in the `ROOT/jaxon/App/HelloWorld.php` file.\n\n```php\nnamespace Jaxon\\App;\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-cake/issues\n- Source Code: github.com/jaxon-php/jaxon-cake\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-cake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaxon-php%2Fjaxon-cake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxon-php%2Fjaxon-cake/lists"}