Last active
December 13, 2018 12:16
-
-
Save ercanertan/66ca7039adeaef3004c8bedeb48758e5 to your computer and use it in GitHub Desktop.
Popup Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="modal fade" id="myModal" role="dialog"> | |
<div class="modal-dialog"> | |
<!-- Modal content--> | |
<div class="modal-content"> | |
<div class="modal-body"> | |
<h1>Sample</h1> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<?php | |
$popup_url = "/" | |
?> | |
<?php if( $_SERVER["REQUEST_URI"] == $popup_url):?> | |
<?php if (isset($_COOKIE['key'])): ?> | |
<?php if ($_COOKIE['key']=='show'): ?> | |
<script type="text/javascript"> | |
$( document ).ready(function() { | |
$("#myModal").modal(); | |
{{ \Cookie::queue('pop_up', 'hide', 1) }} | |
}); | |
</script> | |
<?php endif; ?> | |
<?php else: ?> | |
<?php endif; ?> | |
<?php endif; ?> | |
//Controller or blade | |
if(is_null(Cookie::get('pop_up'))){ | |
Cookie::queue('pop_up', 'show', 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment