{"id":15277411,"url":"https://github.com/tattersoftware/codeigniter4-layouts","last_synced_at":"2025-06-11T17:36:50.590Z","repository":{"id":40662769,"uuid":"432825621","full_name":"tattersoftware/codeigniter4-layouts","owner":"tattersoftware","description":"Layout management service for CodeIgniter 4","archived":false,"fork":false,"pushed_at":"2024-01-18T16:28:52.000Z","size":47,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-04-10T04:41:01.285Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tattersoftware.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-28T21:09:48.000Z","updated_at":"2024-01-18T19:06:53.000Z","dependencies_parsed_at":"2024-10-14T09:22:43.946Z","dependency_job_id":null,"html_url":"https://github.com/tattersoftware/codeigniter4-layouts","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"c3599824ac6e88b7ca9ea439416236ca434ad93b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-layouts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-layouts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-layouts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-layouts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tattersoftware","download_url":"https://codeload.github.com/tattersoftware/codeigniter4-layouts/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586257,"owners_count":21128995,"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-09-30T11:06:01.790Z","updated_at":"2025-04-12T14:52:01.460Z","avatar_url":"https://github.com/tattersoftware.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tatter\\Layouts\nLayout management service for CodeIgniter 4\n\n[![](https://github.com/tattersoftware/codeigniter4-layouts/workflows/PHPUnit/badge.svg)](https://github.com/tattersoftware/codeigniter4-layouts/actions/workflows/test.yml)\n[![](https://github.com/tattersoftware/codeigniter4-layouts/workflows/PHPStan/badge.svg)](https://github.com/tattersoftware/codeigniter4-layouts/actions/workflows/analyze.yml)\n[![](https://github.com/tattersoftware/codeigniter4-layouts/workflows/Deptrac/badge.svg)](https://github.com/tattersoftware/codeigniter4-layouts/actions/workflows/inspect.yml)\n[![Coverage Status](https://coveralls.io/repos/github/tattersoftware/codeigniter4-layouts/badge.svg?branch=develop)](https://coveralls.io/github/tattersoftware/codeigniter4-layouts?branch=develop)\n\n## Description\n\nThis library provides a commons means of managing [View Layouts](https://codeigniter.com/user_guide/outgoing/view_layouts.html)\nacross package modules and applications.\n\n## Installation\n\nInstall easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities\nand always be up-to-date:\n* `\u003e composer require tatter/layouts`\n\nOr, install manually by downloading the source files and adding the directory to\n`app/Config/Autoload.php`.\n\n## Configuration\n\nThe code of `Layouts` amounts to a single config file: `Tatter\\Layouts\\Config\\Layouts`. This\nfile provides the path for each layout as a property. Initially the config file only\nincludes a single property: \"default\". By supplying your own path via an `App` config file\nyou can direct any package or module using `Layouts` to use your layout instead. For example,\n**app/Config/Layouts.php**:\n```php\n\u003c?php\n\nnamespace \\Config;\n\nclass Layouts extends \\Tatter\\Layouts\\Config\\Layouts\n{\n\tpublic $default = 'App\\Views\\project_layout';\n}\n```\n\n## Usage\n\nTo use the configured layout, simply provide the config property to your view file:\n```php\n\u003c?= $this-\u003eextend(config('Layouts')-\u003edefault) ?\u003e\n\u003c?= $this-\u003esection('main') ?\u003e\n\n\t\u003cp\u003eHellow world!\u003c/p\u003e\n\n\u003c?= $this-\u003eendSection() ?\u003e\n```\n\nYou can use any layout name you have configured, and any name that does not match will fall\nback on the path supplied for \"default\".\n\n\u003e See the CodeIgniter User Guide to read more on [View Layouts](https://codeigniter.com/user_guide/outgoing/view_layouts.html)\n\n## Layout Expectations\n\nFor consistency this library assumes that the \"default\" template will have the following sections:\n* **headerAssets**: The last section prior to the closing `\u003c/head\u003e` tag, available for adding CSS tags and the like.\n* **navbar**: A navigation menu, typically to be displayed along the top of the page.\n* **main**: The main content for the page (can include nested views, etc).\n* **footerASsets**: The last section prior to the closing `\u003c/body\u003e` tag, available for adding JS tags and footer content.\n\n## Default Layout\n\nWhile it is highly recommended that you supply your own \"default\" layout, this library includes\na generic one as a fallback. This layout is based on the [Bootstrap Starter Template](https://getbootstrap.com/docs/5.1/examples/starter-template)\nand includes CDN tags for Bootstrap CSS and JS. In addition to fulfilling the expectations above,\nthe layout also accepts the following variables to configure the HTML `\u003chead\u003e` data:\n* **$headerDescription**\n* **$headerAuthor**\n* **$headerTitle**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftattersoftware%2Fcodeigniter4-layouts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftattersoftware%2Fcodeigniter4-layouts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftattersoftware%2Fcodeigniter4-layouts/lists"}