PHP code example of torgheh / bootmodal

1. Go to this page and download the library: Download torgheh/bootmodal library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

torgheh / bootmodal example snippets


	'Torgheh\Bootmodal\BootmodalServiceProvider'

	'Modal'  => 'Torgheh\Bootmodal\Facades\Modal',


return \Modal::make('dialogs.login')->with('data', $data);

return \Modal::make('dialogs.login')->withInput()->withErrors($validation);

return \Modal::redirect($url);

retun \Modal::redirect($url)->withError($validator)->with('message', 'error');

return \Modal::make('dialogs.login')->with('data', $data)->setOption('size', 'sm')->setOption('title', 'Login');

@extends('bootmodal::layout')
@section('modal-content')
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		<h4 class="modal-title" >Login</h4>
	</div>

	<form id="login-form" action="{{url('login')}}" method="post" data-toggle="bootmodal">
		<div class="modal-body">
			<ul id="errors">
				@foreach($errors->all() as $error )
					<li>{{$error}}</li>
				@endforeach
			</ul>

			<label class="control-label">
			Email: <input type="text" class="form-control" name="email" value="{{\Input::old('email')}}">
			</label>

			<label class="control-label">
			Password: <input type="password" class="form-control" name="password">
			</label>
		</div>
		<div class="modal-footer text-right" >
			<input type="submit" class="btn btn-default" value="login">
		</div>

	</form>
@stop


class AuthController extends BaseController
{
	public function showLoginDialoge()
	{
		$foo = '';
		return \Modal::make('dialogs.login', compact('foo'));
	}
	public function postLogin()
	{
		$rules = ['email'=>'e('dialogs.login')->withErrors($validator)->withInput();
	}
	...
}

Route::get('login', array( 'uses'=>'AuthController@showLoginDialoge') );
Route::post('login', array( 'uses'=>'AuthController@postLogin') );
sh
php artisan asset:publish torgheh/bootmodal
html
<form action="{{url('login')}} method="post" data-toggle="bootmodal">