Package Data | |
---|---|
Maintainer Username: | jehadja |
Maintainer Contact: | jehad.jaghoub2@gmail.com (Jehad jaghoub) |
Package Create Date: | 2017-06-23 |
Package Last Update: | 2017-06-27 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:01:28 |
Package Statistics | |
---|---|
Total Downloads: | 70 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Using Composer
composer require jaghoub/izitools
Add the service provider to config/app.php
jaghoub\izitools\izitoolsServiceProvider::class,
Optionally include the Facade in config/app.php
if you'd like.
'izitools' => jaghoub\izitools\Facades\izitools::class,
From your application, call the izime
method with a options and type.
include styles
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.1.1/css/iziToast.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/izimodal/1.4.2/css/iziModal.css" />
include javascript
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.1.1/js/iziToast.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/izimodal/1.4.2/js/iziModal.min.js"></script>
if use Facade
izitools()->izime('tosat', [
'title'=> 'Welcome to laravel Website Test !',
'message'=>'is simply dummy text of the printing and typesetting industry. ',
'color'=>'green',
'position'=>'center'
]);
---
or
---
izitools()->izime('modal', [
'title'=> 'Welcome to laravel Website Test !',
'iframe'=>true,
'iframeHeight'=>800,
'iframeURL'=>'http://izimodal.dolce.ninja'
]);
without Facade
izitools::izime('tosat', [
'title'=> 'Welcome to laravel Website Test !',
'message'=>'is simply dummy text of the printing and typesetting industry. ',
'color'=>'green',
'position'=>'center'
]);
---
or
---
izitools::izime('modal', [
'title'=> 'Welcome to laravel Website Test !',
'iframe'=>true,
'iframeHeight'=>800,
'iframeURL'=>'http://izimodal.dolce.ninja'
]);
Within a view, you can now check if a flash message exists and output it.
@if (izitools::ready())
{{ izitools::type() }}
@endif
You can pass additional options to the izime
method, which are then easily accessible within your view.
izitools::izime('modal', [
'title'=> 'Welcome to laravel Website Test !',
etc ...
]);
Then, in your view without Facade.
@if (izitools::ready())
<script>
$(document).ready(function(){
@if (izitools::type() =='tosat')
iziToast.show({
{!! izitools::options() !!}
});
@elseif(izitools::type() =='modal')
$("#modal").iziModal({
{!! izitools::options() !!}
});
$('#modal').iziModal('open');
@else
iziToast.show({
title: 'this option not Available',
message: 'this packages include only modal and tosat type please select one of them while sending data',
color:'red'
});
@endif
});
</script>
@endif
with using Facade
@if (izitools()->ready())
<script>
$(document).ready(function(){
@if (izitools()->type() =='tosat')
iziToast.show({
{!! izitools::options() !!}
});
@elseif(izitools()->type() =='modal')
$("#modal").iziModal({
{!! izitools()->options() !!}
});
$('#modal').iziModal('open');
@else
iziToast.show({
title: 'this option not Available',
message: 'this packages include only modal and tosat type please select one of them while sending data',
color:'red'
});
@endif
});
</script>
@endif
its not suggested to use {!! !!} method on real app it will allow the attack of XSS unless you are sure about data will be pushed .
'better user the method izitools::option("option_name")'
The above example uses izimodal,izitosat but the flexibily of izitools means you can easily use it with any JavaScript alert solution.
Just submit an issue or pull request through GitHub. Thanks!