{"id":23529912,"url":"https://github.com/mnvx/iris-php-framework","last_synced_at":"2025-05-14T12:33:15.372Z","repository":{"id":6257543,"uuid":"7490310","full_name":"mnvx/iris-php-framework","owner":"mnvx","description":"Iris PHP Framework","archived":false,"fork":false,"pushed_at":"2013-04-13T21:02:37.000Z","size":916,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T03:28:30.721Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnvx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-07T21:34:32.000Z","updated_at":"2014-04-06T16:13:39.000Z","dependencies_parsed_at":"2022-07-11T00:00:26.342Z","dependency_job_id":null,"html_url":"https://github.com/mnvx/iris-php-framework","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/mnvx%2Firis-php-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnvx%2Firis-php-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnvx%2Firis-php-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnvx%2Firis-php-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnvx","download_url":"https://codeload.github.com/mnvx/iris-php-framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142183,"owners_count":22021474,"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-12-25T21:14:14.288Z","updated_at":"2025-05-14T12:33:15.352Z","avatar_url":"https://github.com/mnvx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Iris PHP Framework\n\nFast MVC framework with transparent architecture and adaptive desigh for programmers, who want to create their web project rapidly and cleanly for both desktop and mobile platforms\n\n## Advantages\n* MVC\n* Multilingual\n* Adaptive design\n* Desktop and mobile version\n* Caching\n* High performance\n* Friendly URLs\n* Easy to use\n* Easy to update\n\n## Screenshots\nDesktop version:  \n![Iris PHP Framework](http://storage8.static.itmages.ru/i/13/0112/h_1357958773_4621523_2994f5dd48.png \"Desktop version\")\n\nMobile version:  \n![Iris PHP Framework](http://storage9.static.itmages.ru/i/13/0112/h_1357958799_9080468_e61ac78baf.png \"Mobile version\")\n\n## Requirements\n* PHP 5.4+\n* php_pdo extension (default - sqlite)\n* mod_rewrite Apache module\n\n## Catalog structure\n* cache - cached pages\n* core - core files, please, do not edit them in your project, later you can update this folder, when new version of framework will be released\n* data - data files (database for sqlite and other possible files)\n* project - your project files, you can edit this files as you need\n  - model - files for work with data\n  - controller - files for processing of user actions\n  - view - templates for pages\n* locale - translations, you can edit whem with Poedit editor, [more info about translations](http://php.net/manual/en/book.gettext.php \"PHP gettext\")\n* plugins - plugins\n* static - css, js files, images and other static information\n* temp - temp files\n\n## Installation\n1. Copy files into your web files folder \n2. Set write access for \"cache\" and \"data\" folders\n3. Edit file `project/config.php` (set value of `Config::$base_url`)\n4. Installation completed\n\n## First step: How to add your controller\n1. Edit routes: `Config::$routes` (see standart routes for example), add needed route\n2. Add controller into `project/controller`\n3. Add view into `project/view`\n4. If necessery, add model into `project/model`\n\n## License\n[MIT](http://opensource.org/licenses/mit-license.php)\n\nThe MIT License (MIT)\nCopyright (c) 2012 mnv\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## Involvement\nWelcome: [Github](https://github.com/iriscrm/iris-php-framework \"Iris PHP Framework on GitHub\")\n\n# Example\n\n## Creation of new page with new controller, view, model, query and link in main menu (common case)\n\n### Add new router\n\nAdd new element into `Config::routes` (file `project\\config.php`)\n\n    'orders' =\u003e array(\n      'pattern' =\u003e'/orders', \n      'controller' =\u003e 'order', \n      'action' =\u003e 'index',\n    ),\n\n### Add new controller\n\nCreate file `project\\controller\\ordercontroller.php`\n\n    \u003c?php\n    namespace IrisPHPFramework;\n    /**\n     * Order Controller\n     */\n\n    class OrderController extends Controller {\n      /**\n       * Order list page.\n       */\n      function indexAction() {\n        $this-\u003elogin_required();\n\n        $class_view = get_final_class_name('View');\n        $view = $class_view::singleton();\n        $view-\u003eassign('order_list', OrderModel::singleton()-\u003eget_list(UserModel::singleton()-\u003elogin));\n        $view-\u003eset_title(_('My orders'));\n        $view-\u003erender(\"order\", \"orders\");\n      }\n    }\n    ?\u003e\n\n### Add new model\n\nCreate file `project\\model\\order.php`\n\n    \u003c?php\n    namespace IrisPHPFramework;\n    /**\n     * Order Model\n     */\n\n    class OrderModel {\n      use Singleton;\n      protected $msg;\n      function get_list($client_number)\n      {\n        $db = DB::singleton();\n        $query = $db-\u003eget_client_order_list('db', $client_number);\n        if (!$query) {\n          $this-\u003emsg = $db-\u003eget_msg();\n          return false;\n        }\n        // Fetch all results and process the data if the row exists.\n        $results = $query-\u003efetchAll();\n        return $results;\n      }\n    }\n    ?\u003e\n\nEdit `project\\index.php`\n    ...\n    require_once(Config::project_path().'/model/order.php');\n    ...\n\n### Add new database query\n\nAdd new method into `DB` class (file `project\\db.php`)\n\n    public function get_client_order_list($db_name, $client) {\n      $sql = \"\n        select '11227' as docnum, '2013-01-15' as docdate, 1200 as amount, 'Oil change' as claim\n        union\n        select '11122' as docnum, '2013-01-13' as docdate, 3120 as amount, null as claim\n        union\n        select '11023' as docnum, '2013-01-12' as docdate, 120.45 as amount, null as claim\n      \";\n      return $this-\u003erun_query($sql, array(), $db_name);\n    }\n\n### Add new view\n\nCreate file `project\\view\\order\\orders.html.php`\n\n    \u003c?php namespace IrisPHPFramework; ?\u003e\n    \u003c?php \n      $profile = $user-\u003eget_profile_info(); \n      $orders = $view-\u003eget('order_list');\n    ?\u003e\n\n    \u003ch2\u003e\u003c?php echo _('My orders'); ?\u003e\u003c/h2\u003e\n    \n    \u003cdiv class=\"orders\"\u003e\n\n      \u003ctable class=\"table\"\u003e\n      \u003ctr\u003e\n        \u003cth\u003e\u003c?php echo _('Order number'); ?\u003e\u003c/th\u003e\n        \u003cth\u003e\u003c?php echo _('Date'); ?\u003e\u003c/th\u003e\n        \u003cth\u003e\u003c?php echo _('Amount'); ?\u003e\u003c/th\u003e\n        \u003cth\u003e\u003c?php echo _('Claim'); ?\u003e\u003c/th\u003e\n      \u003c/tr\u003e\n      \n      \u003c?php foreach ($orders as $order_info) { ?\u003e\n        \u003ctr\u003e\n          \u003ctd\u003e\u003c?php echo $view-\u003eescape($order_info['docnum']); ?\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003c?php echo $view-\u003eescape($order_info['docdate']); ?\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003c?php echo $view-\u003eescape($order_info['amount']); ?\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003c?php echo $view-\u003eescape($order_info['claim']); ?\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n      \u003c?php } ?\u003e\n      \u003c/table\u003e\n\n    \u003c/div\u003e\n\n### Add link for this page in menu\n\nEdit files `project\\view\\site\\home-d.html.php` and `project\\view\\site\\home-m.html.php`\n\n    ...\n    \u003cli\u003e\u003ca href=\"\u003c?php echo $router-\u003eprefix_url(); ?\u003e/orders\"\u003e\u003c?php echo _('My orders'); ?\u003e\u003c/a\u003e\u003c/li\u003e\n    ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnvx%2Firis-php-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnvx%2Firis-php-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnvx%2Firis-php-framework/lists"}