{"id":15309045,"url":"https://github.com/marcelod/codeigniter-skeleton","last_synced_at":"2025-10-08T16:31:18.373Z","repository":{"id":25913223,"uuid":"29354076","full_name":"marcelod/CodeIgniter-Skeleton","owner":"marcelod","description":"A decent starter for most web apps. Includes HMVC, jQuery, Bootstrap, Bootstrap TLDR, Ajax and Template libraries. Unit tests with PHPUnit and vfsStream.","archived":false,"fork":true,"pushed_at":"2015-01-16T17:24:33.000Z","size":1573,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-02T08:19:59.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"anvoz/CodeIgniter-Skeleton","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcelod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-16T15:26:56.000Z","updated_at":"2015-01-16T17:24:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/marcelod/CodeIgniter-Skeleton","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelod%2FCodeIgniter-Skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelod%2FCodeIgniter-Skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelod%2FCodeIgniter-Skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelod%2FCodeIgniter-Skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelod","download_url":"https://codeload.github.com/marcelod/CodeIgniter-Skeleton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235731878,"owners_count":19036821,"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-01T08:20:04.456Z","updated_at":"2025-10-08T16:31:17.868Z","avatar_url":"https://github.com/marcelod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"CodeIgniter Skeleton [![Build Status](https://travis-ci.org/anvoz/CodeIgniter-Skeleton.png?branch=master)](https://travis-ci.org/anvoz/CodeIgniter-Skeleton)\n====================\n\nCodeIgniter Skeleton (CIS) is not only a decent starting point for most web apps but also a new experience for CI-based development to ajaxify everything.\n\n![cis](https://cloud.githubusercontent.com/assets/4688035/2561535/471eba12-b81c-11e3-93d2-130d011f6b13.PNG)\n\n## Include\n\n### Core\n\n* [CodeIgniter](https://github.com/EllisLab/CodeIgniter) 2.2.0 (last updated: Jun 6, 2014)\n* [Modular Extensions - HMVC](https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc) 5.4 (last updated: Oct 4, 2013)\n* [jQuery](https://github.com/jquery/jquery) 1.11.1 (last updated: May 2, 2014)\n* [Bootstrap](https://github.com/twbs/bootstrap) 3.2.0 (last updated: Jun 26, 2014)\n* [Bootstrap TLDR](https://github.com/anvoz/bootstrap-tldr) 1.1.0 (last updated: Mar 22, 2014)\n* Template library: handle masterview and views within masterview\n* Ajax request \u0026 response library: provide rapid ways to ajaxify everything\n\n### Add-ons\n\nAdd-ons are custom builds of some useful libraries and plugins. They are **not included** in the project but already have a quick mechanic to install by (at least) simply clicking on the `Copy` button in Add-ons page.\n\n* Bootstrap form helpers: generate HTML form fields and buttons with Bootstrap CSS style\n* [Ion Auth](https://github.com/benedmunds/CodeIgniter-Ion-Auth) 2.6.0 (last updated: Jul 31, 2014)\n* [jQuery File Upload](https://github.com/blueimp/jQuery-File-Upload) 9.5.7 (last updated: Mar 11, 2014)\n* [validate.js](https://github.com/rickharrison/validate.js) 1.4 (last updated: Apr 14, 2014)\n\n### Example\n\nGetting started with a basic todo example which will help you learn how to use CIS in the right way.\n\n![todo-example](https://cloud.githubusercontent.com/assets/4688035/2561537/557533de-b81c-11e3-8590-8fd4c11ab30b.PNG)\n\n## Directory Structure\n\n### Application\n\n```\nconfig/\n    assets.php                      // Config base URL for assets\ncore/\n    MY_Controller.php               // MY_Controller \u0026 Ajax_Controller\nhelper/\n    MY_url_helper.php               // Contain assets_url() function\nlibrary/\n    Dialog.php                      // Generate HTML for Bootstrap's Modal dialog\n    Response.php                    // Handle response for ajax request\n    Template.php                    // Handle masterview and views within masterview\nmodules/\n    addons/                         // Add-ons management\n    skeleton/                       // Showcase of all included components\n    todo/                           // Todo example\nthird_party/\n    MX/                             // Modular Extensions - HMVC\nviews/\n    layout/\n        default.php                 // Header + full width container\n        pagelet.php                 // Header + half width container\n    base_view.php                   // Masterview\n    dialog.php                      // HTML template for Bootstrap's Modal dialog\n    header.php                      // Page header\n```\n\n### Assets\n\nUse `MY_url_helper` `assets_url()` to get URL of Javascript, CSS or image resource\n\n```\ncss/\n    modules/\n        {{module}}.css              // Extra CSS for a specific module\n    bootstrap.min.css               // Bootstrap core CSS\n    main.css                        // CSS for all pages\njs/\n    modules/\n        {{module}}.js               // Extra JS for a specific module\n    bootstrap.min.js                // Bootstrap core JS\n    html5shiv.js, respond.min.js    // IE8 support of HTML5 elements and media queries\n    jquery.min.js                   // jQuery core JS\n    main.js                         // JS for all pages\n```\n\n## Usage\n\n### Setup\n\nBy default, you will be albe to check all features on the home page without doing any of the following instructions. Just unzip the package and put the source code in your server.\n\n* Set your base URL in `application/config/config.php` file.  \nExample: `$config['base_url'] = 'http://example.com/';`\n* Set your assets URL in `application/config/assets.php` file.  \nExample: `$config['assets_url'] = 'http://example.com/assets/';`\n\n**Note:** Base and assets URLs should be absolute, including the protocol.\n\n[H5BP's Server Configs](https://github.com/h5bp/server-configs): Best-practice server configurations to help improve site performance.\n\n[CodeIgniter Nginx Rewrite Rules](https://github.com/anvoz/CodeIgniter-Skeleton/wiki/CodeIgniter-Nginx-Rewrite-Rules)\n\n### Unit Tests\n\n```\nphpunit --coverage-text --configuration tests/phpunit.xml\n```\n\nPlease take a look at [this](https://github.com/anvoz/CodeIgniter-Skeleton/tree/master/tests) for more info.\n\n### Guidelines\n\n#### Rendering page (with base view)\n\nBase view (masterview) is a well-designed HTML page based on [Bootstrap](https://github.com/twbs/bootstrap) and [HTML5 Boilerplate](https://github.com/h5bp/html5-boilerplate) template.\n```php\n\u003c?php\nclass Welcome extends MY_Controller {\n    // URL: {{site_url}}/welcome/example\n    public function example()\n    {\n        $this-\u003eload-\u003elibrary('template');\n        // The below function is as same as $this-\u003eload-\u003eview('welcome/example')\n        // but its output will be placed inside a base view\n        $this-\u003etemplate-\u003eload_view('welcome/example');\n    }\n}\n```\nUse other methods of the `Template` library to customize base view: `set_layout`, `set_title`, `set_description`, `add_metadata`, `add_js`, `add_css`.\n\n#### Rendering pagelet\n\nA single web page should be broken down into small pieces which are called pagelets. Pagelet is a set of self-contained MVC and Javascript functions that should be loaded independently via both normal page render and ajax request render.\n```php\n\u003c?php\n// Must extend MY_Controller to use HMVC Modular Extensions\nclass Welcome extends MY_Controller {\n    // Pagelet should have _pagelet_ prefix\n    public function _pagelet_example()\n    {\n        $this-\u003eload-\u003eview('welcome/pagelet_example');\n    }\n}\n```\nUse `Modules::run('welcome/_pagelet_example')` to get pagelet HTML output.\n\n#### Writing Javascript inside the page body\n```php\n\u003c?php\n$this-\u003e_load_script('$(function() {\n    console.log(\"The DOM is loaded.\");\n});');\n```\nTo minify blocking time while the browser is executing Javascript, the script will be queued and only be executed after the page is completely rendered.\n\n**Note:** The `_load_script` function simply echos the script so you can not use it in the same block with `$this-\u003etemplate-\u003eload_view` function which will echo a whole page. It should be used inside a pagelet, please check this [example](https://github.com/anvoz/CodeIgniter-Skeleton/blob/master/application/modules/addons/data/validate_js/controllers/form_validation_example.php#L67-L77).\n\n#### Executing function after all of the required Javascript files were loaded\n```js\nCIS.Script.require('{{js_file_path}}', function() {\n    console.log(\"Plugins are loaded.\");\n    $(function() {\n        console.log(\"The DOM is loaded.\");\n    });\n});\n```\n\n#### Ajaxifying request\nVia links: `\u003ca href=\"#\" rel=\"async\" ajaxify=\"{{ajax_url}}\"\u003e...\u003c/a\u003e`\n\nVia forms: `\u003cform rel=\"async\" action=\"{{ajax_url}}\"\u003e...\u003c/form\u003e`\n\nVia Javascript function: `CIS.Ajax.request('{{ajax_url}}'[, settings])`\n\n#### Handling ajax response\n```php\n\u003c?php\n// Should extend Ajax_Controller to use the Response library\nclass Welcome_ajax extends Ajax_Controller {\n    // URL: {{site_url}}/welcome/welcome_ajax/example\n    function example()\n    {\n        // The request must be called via\n        // \u003ca rel=\"async\" href=\"#\" ajaxify=\"{{URL}}\"\u003e\n        // or CIS.Ajax.request() function (located at main.js)\n        // to be able to execute the response script below\n        $this-\u003eresponse-\u003escript('console.log(\"Responded.\");');\n        $this-\u003eresponse-\u003esend();\n    }\n}\n```\nUse `alert`, `confirm` and `dialog` functions of the `Response` library to display dialog in client-side.\n\n## License\n\nCopyright An Vo [@an_voz](https://twitter.com/an_voz), 2013-2014.\n\n[CodeIgniter License Agreement](http://ellislab.com/codeigniter/user-guide/license.html), everything else is released under the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelod%2Fcodeigniter-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelod%2Fcodeigniter-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelod%2Fcodeigniter-skeleton/lists"}