Advertisement
Guest User

Untitled

a guest
May 28th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. views/test/prueba.blade.php
  2. --------------------------
  3. hello TEST
  4.  
  5. main page code:
  6. ----------------
  7. <div id="user_links" name="user_links" class="user_links_class a_user_links_class">
  8. <a data-title="{{ Lang::get('messages.loginHeaderAccount_Login_tooltip') }}" class="a_user_links_class"
  9. href="#" onclick="loginSendJS();return false;">
  10. {{ Lang::get('messages.loginHeaderAccount_Login') }}
  11. </a>
  12. </div>
  13.  
  14. <script>
  15. function loginSendJS()
  16. {
  17. var urlToTrigger = "{{ URL::route('account-login') }}";
  18. onHeaderLogin(urlToTrigger);
  19. }
  20. function onHeaderLogin(urlToTrigger)
  21. {
  22. $("#BodyDarkGateS").empty();
  23. $("#BodyDarkGateS").load(urlToTrigger);
  24. }
  25. </script>
  26.  
  27. routes.php
  28. ==============
  29. Route::get('/', 'WelcomeController@index');
  30. Route::get('/darkgates', array(
  31. 'as' => 'home',
  32. 'uses' => 'WelcomeController@index' // @home es el method
  33. ));
  34.  
  35. // Authentication routes...
  36. Route::post('/account/login', array( 'as' => 'account-login','uses' => 'HomeController@showHomePage'));
  37.  
  38.  
  39. HomeController.php
  40. ====================
  41. <?php namespace App\Http\Controllers;
  42.  
  43. class HomeController extends Controller {
  44.  
  45. /*
  46. |--------------------------------------------------------------------------
  47. | Home Controller
  48. |--------------------------------------------------------------------------
  49. |
  50. | This controller renders your application's "dashboard" for users that
  51. | are authenticated. Of course, you are free to change or remove the
  52. | controller as you wish. It is just here to get your app started!
  53. |
  54. */
  55.  
  56. /**
  57. * Create a new controller instance.
  58. *
  59. * @return void
  60. */
  61. public function __construct()
  62. {
  63. echo "J1";
  64. $this->middleware('auth');
  65. echo "J2";
  66. }
  67.  
  68. /**
  69. * Show the application dashboard to the user.
  70. *
  71. * @return Response
  72. */
  73. public function index()
  74. {
  75. echo "J3";
  76. Log::debug('HomeController.php index():: Retornando vista home');
  77. return view('home');
  78. }
  79.  
  80.  
  81. /**
  82. * Muestra la página de inicio de Dark Gates RO
  83. * @return Response
  84. */
  85. public function showHomePage()
  86. {
  87. echo "J4";
  88. return "HELLO";
  89. }
  90. }
  91.  
  92.  
  93. ERROR:
  94.  
  95. GET http://localhost:13400/account/login
  96.  
  97. 405 Method Not Allowed 224ms
  98. jquery-....min.js (línea 4)
  99. "NetworkError: 405 Method Not Allowed - http://localhost:13400/account/login"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement