All Projects → xdn27 → codeigniter-alert

xdn27 / codeigniter-alert

Licence: other
An easy flashdata alert for codeigniter

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to codeigniter-alert

pusher-for-codeigniter
CodeIgniter library for Pusher PHP SDK
Stars: ✭ 27 (+35%)
Mutual labels:  codeigniter
KI-Board
Codeigniter & Bootstrap 기반 게시판
Stars: ✭ 13 (-35%)
Mutual labels:  codeigniter
gameap-legacy
Free Game Admin Panel
Stars: ✭ 37 (+85%)
Mutual labels:  codeigniter
searchmap
Find places and Draw on Map using Google Maps API
Stars: ✭ 53 (+165%)
Mutual labels:  codeigniter
PHP-Frameworks-Bench
Popular PHP Frameworks Benchmark.
Stars: ✭ 28 (+40%)
Mutual labels:  codeigniter
CodeIgniter-Adjacency-List
Simple implementation with nestedSortable plugin.
Stars: ✭ 18 (-10%)
Mutual labels:  codeigniter
php-clamav-scan
A simple PHP library for ClamAV that is CodeIgniter compatible
Stars: ✭ 35 (+75%)
Mutual labels:  codeigniter
codeigniter-image-magician
🎨 An ImageMagick library for CodeIgniter.
Stars: ✭ 13 (-35%)
Mutual labels:  codeigniter
SimpleIPAM
Simple IP address management
Stars: ✭ 28 (+40%)
Mutual labels:  codeigniter
Codeigniter3-absen-digital
Sistem Absensi Online dengan framework codeigniter 3
Stars: ✭ 33 (+65%)
Mutual labels:  codeigniter
codeigniter-monolog-plus
codeigniter monolog plus
Stars: ✭ 13 (-35%)
Mutual labels:  codeigniter
Hotel-Management-System
Web Base Hotel Management System base on CI
Stars: ✭ 57 (+185%)
Mutual labels:  codeigniter
CodeIgniter3-online-shop
A full e-commerce project built with CI3 HMVC with Email confirmation,Paypal payement , Ion Auth , Live Chatroom and full admin dashboard
Stars: ✭ 114 (+470%)
Mutual labels:  codeigniter
tutorial-codeigniter
Tutorial Codeigniter untuk pemula
Stars: ✭ 108 (+440%)
Mutual labels:  codeigniter
CodeIgniter-Minifyhtml-hooks
A CodeIgniter Hooks that will Minify the HTML, Reducing network latency, enhancing compression, and faster browser loading and execution.
Stars: ✭ 30 (+50%)
Mutual labels:  codeigniter
anofie
Anofie is an ultimate anonymous feedback script for personal & corporate use. A sarahah clone script to collect honest suggestions & feedback.
Stars: ✭ 21 (+5%)
Mutual labels:  codeigniter
CIVueJS
Codeigniter + VueJS
Stars: ✭ 25 (+25%)
Mutual labels:  codeigniter
FusionCMS
A CMS for World of Warcraft private servers
Stars: ✭ 18 (-10%)
Mutual labels:  codeigniter
codeigniter-react-boilerplate
A CodeIgniter boilerplate with React.
Stars: ✭ 35 (+75%)
Mutual labels:  codeigniter
OneSignal-Codeigniter-Push-Notification
OneSignal is a free push notification service for web and mobile apps. This Codeigniter example makes it easy to integrate your website with OneSignal Push Notifications. https://onesignal.com/ DEMO - http://ci3onesignal.codefort.ru/
Stars: ✭ 27 (+35%)
Mutual labels:  codeigniter

codeigniter-alert

An easy flashdata alert for codeigniter
This is just a simple alert..

How To Use

File

Put the Alert.php in the application/library
Put the alert_helper.php in the application/helper
Load the library automatically..

The library is work with the codeigniter 2.2 and 3.0

Set an Alert

  • NAME(String): Your alert name/type/class/whatever..
  • MESSAGE(String): Of course this is for the message..
  • 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

$this->alert->set(NAME, MESSAGE, NEXT REQUEST);

Display an alert

echo has_alert(NAME);
print_r(has_alert());

Sample

Controller

public function index()
{
	if(!auth_check('member')){
		
		// Alert will show after redirect
		$this->alert->set('alert-danger', 'Orang asing dilarang masuk!');
		redirect(base_url('auth/login'));
	}
	
	redirect(base_url());
}

public function login()
{
	if($this->input->post('do_login') AND !$this->do_login()){
		
		// This is not for next request
		$this->alert->set('alert-danger', 'Login gagal!', true);
	}
	
	$this->load->view('login');
}

View

<?php if(has_alert()):  
	foreach(has_alert() as $type => $message): ?>  
		<div class="alert alert-dismissible <?php echo $type; ?>">  
			<button type="button" class="close" data-dismiss="alert"><span>&times;</span></button>
			<?php echo $message; ?>  
		</div>  
	<?php endforeach;  
endif; ?>

Very simple..
Thanks

Tweet your question to @d_nizh

Bahasa Indonesia http://kabisadenis.net/php/codeigniter/membuat-alert-pada-codeigniter-dengan-mudah/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].