-1

web.php

Route::get('/index/{forum}/{php}/{framework}/questions', function($forum, $php, $framework){
    return view('questions')->with('forum', $forum)->with('php', $php)->with('framework', 
$framework);
});

questions.blade.php

1. = {{forum}} / 2. = {{php}} / 3. = {{framework}}

I'm trying this but i get this error.

C. Aydın
  • 21
  • 4
  • Please ALWAYS show us ALL the erro rmessage and not a summary. Error messages normally come with line numbers and filename of where an error occurs – RiggsFolly Oct 09 '19 at 15:57

1 Answers1

3

Blade curly braces are basically PHP echo function, so act accordingly

1. = {{ $forum }} / 2. = {{ $php }} / 3. = {{ $framework }}

Calling a variable without the $ dollar sign is reserved for constants and you haven't defined such constants

Here's what happens in the background of this Blade line

1. = <?php echo e(forum); ?> / 2. = <?php echo e(php); ?> / 3. = <?php echo e(framework); ?>

<?php /**PATH resources/views/welcome.blade.php ENDPATH**/ ?>

You can see that forum, php and framework are called as constants here, while you want to output variables

1. = <?php echo e($forum); ?> / 2. = <?php echo e($php); ?> / 3. = <?php echo e($framework); ?>

<?php /**PATH resources/views/welcome.blade.php ENDPATH**/ ?>

Hope this helps

Salim Djerbouh
  • 10,719
  • 6
  • 29
  • 61