Created
November 21, 2012 11:53
-
-
Save ashitvora-zz/4124520 to your computer and use it in GitHub Desktop.
Open form by routes in Laravel
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
/** | |
* Open form for a Route | |
*/ | |
Form::macro('open_by_route', function($route, $params = array(), $attributes = array(), $type = "POST"){ | |
return Form::open( URL::to_route( $route, $params ), $type, $attributes ); | |
}); | |
/** | |
* Open secure form for a Route | |
*/ | |
Form::macro('open_secure_by_route', function($route, $params = array(), $attributes = array(), $type = "POST"){ | |
return Form::open_secure( URL::to_route( $route, $params ), $type, $attributes ); | |
}); | |
/** | |
* Open form for a Route that accepts File | |
*/ | |
Form::macro('open_for_file_by_route', function($route, $params = array(), $attributes = array(), $type = "POST"){ | |
return Form::open_for_files( URL::to_route( $route, $params ), $type, $attributes ); | |
}); | |
/** | |
* Open secure form for a Route | |
*/ | |
Form::macro('open_secure_for_file_by_route', function($route, $params = array(), $attributes = array(), $type = "POST"){ | |
return Form::open_secure_for_files( URL::to_route( $route, $params ), $type, $attributes ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment