{"id":15470539,"url":"https://github.com/himanshu31shr/ci-boilerplate","last_synced_at":"2025-04-22T12:10:26.721Z","repository":{"id":57039385,"uuid":"123559878","full_name":"himanshu31shr/ci-boilerplate","owner":"himanshu31shr","description":"An advanced boilerplate for codeigniter","archived":false,"fork":false,"pushed_at":"2018-04-11T15:59:15.000Z","size":1881,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"v1","last_synced_at":"2025-04-22T12:10:06.713Z","etag":null,"topics":["boilerplate","codeigniter","codeigniter3","php7"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/himanshu31shr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-02T09:33:30.000Z","updated_at":"2022-05-09T04:14:35.000Z","dependencies_parsed_at":"2022-08-24T00:50:48.248Z","dependency_job_id":null,"html_url":"https://github.com/himanshu31shr/ci-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himanshu31shr%2Fci-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himanshu31shr%2Fci-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himanshu31shr%2Fci-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himanshu31shr%2Fci-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/himanshu31shr","download_url":"https://codeload.github.com/himanshu31shr/ci-boilerplate/tar.gz/refs/heads/v1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237832,"owners_count":21397401,"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":["boilerplate","codeigniter","codeigniter3","php7"],"created_at":"2024-10-02T02:05:16.778Z","updated_at":"2025-04-22T12:10:26.699Z","avatar_url":"https://github.com/himanshu31shr.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CI Boilerplate\nAn advanced boilerplate of codeigniter.\n\n## Prerequisities\n* PHP 7.1+\n* PDO extension.\n* Composer or composer.phar.\n* NPM.\n\n## Getting started\nClone the repo.\nInstall dependencies\n```\ncomposer install\n```\n```\nnpm install\n```\nMigrate database\n```\nphp app migrate\n```\nVoila you are ready to GO!\n\n## Features\n* Twig templating engine.\n* Aauth access control library for user access based on roles and permissions.\n* Common Symphony CLI commands for common tasks, such as development server, generating models, controllers etc.\n* Eloquent ORM.\n* Custom exception handling for managing response based on request type.\n* Webpack and laravel mix for concatenation and minification of js and css libraries.\n* Classmap autoloading for loading custom classes.  \n* Global javascript events.\n\n## Basics\n### Development Server:\nTo start the development server, run following command.\n```\nphp app serve\n```\nYou may also change the default host and port as\n```\nphp app serve \u003chost\u003e \u003cport\u003e\n```\n\n### Generating Models\nTo generate a model, run following command.\n```\nphp app create:model \u003cmodel_name\u003e\n```\nYou may defined sub-directories by adding '/' between directories. Please note that the models will be autoloaded using composer classmap autoloading, so you will need to run 'composer dump-autoload' if creating models manually.\n\nBy default all the models will be extended to Eloquent ORM base class, if you wish to use CI query builder, extend model to 'CI_Model' instead of Eloquent in 'MY_Model' class in core directory.\n\n### Generating Controllers\nTo generate a controller, run following command.\n```\nphp app create:controller \u003ccontroller_name\u003e \u003ccore_class\u003e\n```\nHere core class can be 'AdminController', 'GuestController' or 'UserController'. \n\n### Models\nEloquent ORM has been integrated, to use it effective you will be required to create seperate models for each database table. To use a model, load it using following snippet\n```\n$this-\u003eload-\u003emodel(\u003cModel\u003e)\n```\nOnce loaded you can access the table as per eloquent syntax, for example:\n```\nModel::get(id)\n```\nTo learn more about using eloquent, refer the Laravel's Eloquent [user guide](https://laravel.com/docs/5.5/eloquent)\n\n### Exception handling\nTo throw an exception use following:\n```\nshow_error($error_heading, $message, $template, $error_code) \n```\nThe exception class sends response according to the request type; such that json will be returned in case of ajax, plain text in cli and html in browser.\n\n### Javascript Events\nTo support common crud functions, global events have been added which be readily used for speedy development.\n\n* **Form Event:**\n\nYou can use default form submit event on any form by adding *'ajax-submit'* class on the form element. Form validation is also pre-build with the same event. To validate fields, you may use custom data attributes on the form elements. All of the custom attribute follows [ParsleyJS](http://parsleyjs.org/doc/index.html#validators).\n\nSample form:\n```\n\u003cform action=\"\u003curl\u003e\" class=\"ajax-submit\"\u003e\n\t...\n\t\u003cinput type=\"text\" data-parsley-required name=\"\u003cfield name\u003e\" /\u003e\n\t...\n\u003c/form\u003e\n```\n* **Modal Event:**\nAn event for managing 'bootstrap modals' have also been added. To use it you will have to specify 'open-modal' class on the button or any other clickable element, along with 'data-url' attribute.\n\nSample:\n```\n\u003cbutton class=\"open-modal\" data-url=\"\u003chandler method\u003e\"\u003eOpen Modal\u003c/button\u003e\n```\nHandler method is not prebuilt, you may construct it in any manner you require; with the requirement of response being in following format, in json:\n```\n{\n\t'status': true,\n\t'modal':\u003cmodal html\u003e\n}\n```\n## Resource Handling:\nTo minify css and js dependencies, use:\n```\nnpm run production\n```\nAlternatvely when on development or local server, use:\n```\nnpm run dev\n```\nTo add more global dependencies add packages using npm and include resource file in app.scss and app.js.\n\n## Built with:\n* [codeigniter-ss-twig](https://github.com/kenjis/codeigniter-ss-twig) - Twig wrapper for codeigniter\n* [Eloquent](https://github.com/illuminate/database) - ORM ported from laravel\n* [Symphony Console](https://github.com/symfony/console) - CLI tools from symphony\n* [CodeIgniter-Aauth](https://github.com/magefly/CodeIgniter-Aauth) - ACL library\n\u003c!-- display the social media buttons in your README --\u003e\n\n## Authors:\n* **Himanshu Shrivastava** [LinkedIn](https://www.linkedin.com/in/himanshu31shr/) | [Facebook](https://www.facebook.com/himanshu31shr)\n\t\nSee also the list of [contributors](https://github.com/himanshu31shr/ci-boilerplate/graphs/contributors) who participated in this project.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimanshu31shr%2Fci-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhimanshu31shr%2Fci-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimanshu31shr%2Fci-boilerplate/lists"}