{"id":13560087,"url":"https://github.com/xdn27/codeigniter-alert","last_synced_at":"2025-04-03T15:31:32.400Z","repository":{"id":36912590,"uuid":"41219629","full_name":"xdn27/codeigniter-alert","owner":"xdn27","description":"An easy flashdata alert for codeigniter","archived":false,"fork":false,"pushed_at":"2017-08-26T07:37:35.000Z","size":3,"stargazers_count":22,"open_issues_count":0,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-16T11:39:55.700Z","etag":null,"topics":["codeigniter","php"],"latest_commit_sha":null,"homepage":"","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/xdn27.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":"2015-08-22T18:29:46.000Z","updated_at":"2024-10-19T17:41:13.000Z","dependencies_parsed_at":"2022-09-04T00:11:38.363Z","dependency_job_id":null,"html_url":"https://github.com/xdn27/codeigniter-alert","commit_stats":null,"previous_names":["dnizh93/codeigniter-alert"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdn27%2Fcodeigniter-alert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdn27%2Fcodeigniter-alert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdn27%2Fcodeigniter-alert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdn27%2Fcodeigniter-alert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xdn27","download_url":"https://codeload.github.com/xdn27/codeigniter-alert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247027940,"owners_count":20871625,"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":["codeigniter","php"],"created_at":"2024-08-01T13:00:37.380Z","updated_at":"2025-04-03T15:31:27.386Z","avatar_url":"https://github.com/xdn27.png","language":"PHP","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"# codeigniter-alert\nAn easy flashdata alert for codeigniter  \nThis is just a simple alert..\n\n## How To Use\n\n### File\nPut the Alert.php in the application/library  \nPut the alert_helper.php in the application/helper  \nLoad the library automatically..  \n  \nThe library is work with the codeigniter 2.2 and 3.0  \n\n### Set an Alert\n* NAME(String): Your alert name/type/class/whatever..\n* MESSAGE(String): Of course this is for the message..\n* NEXT REQUEST(Bool / Default: false): Set TRUE if not for next request.. I think you now about this if you have use a flashdata codeigniter\n\n`$this-\u003ealert-\u003eset(NAME, MESSAGE, NEXT REQUEST);`\n\n### Display an alert\n`echo has_alert(NAME);`  \n`print_r(has_alert());`  \n\n## Sample\n\n### Controller\n\n\tpublic function index()\n\t{\n\t\tif(!auth_check('member')){\n\t\t\t\n\t\t\t// Alert will show after redirect\n\t\t\t$this-\u003ealert-\u003eset('alert-danger', 'Orang asing dilarang masuk!');\n\t\t\tredirect(base_url('auth/login'));\n\t\t}\n\t\t\n\t\tredirect(base_url());\n\t}\n\t\n\tpublic function login()\n\t{\n\t\tif($this-\u003einput-\u003epost('do_login') AND !$this-\u003edo_login()){\n\t\t\t\n\t\t\t// This is not for next request\n\t\t\t$this-\u003ealert-\u003eset('alert-danger', 'Login gagal!', true);\n\t\t}\n\t\t\n\t\t$this-\u003eload-\u003eview('login');\n\t}\n\n### View\n\n\t\u003c?php if(has_alert()):  \n\t\tforeach(has_alert() as $type =\u003e $message): ?\u003e  \n\t\t\t\u003cdiv class=\"alert alert-dismissible \u003c?php echo $type; ?\u003e\"\u003e  \n\t\t\t\t\u003cbutton type=\"button\" class=\"close\" data-dismiss=\"alert\"\u003e\u003cspan\u003e\u0026times;\u003c/span\u003e\u003c/button\u003e\n\t\t\t\t\u003c?php echo $message; ?\u003e  \n\t\t\t\u003c/div\u003e  \n\t\t\u003c?php endforeach;  \n\tendif; ?\u003e\n\n\nVery simple..  \nThanks\n\nTweet your question to @d_nizh\n\nBahasa Indonesia\nhttp://kabisadenis.net/php/codeigniter/membuat-alert-pada-codeigniter-dengan-mudah/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdn27%2Fcodeigniter-alert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxdn27%2Fcodeigniter-alert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdn27%2Fcodeigniter-alert/lists"}