Skip to content
Advertisement

Tag: model-view-controller

Too few arguments to function php

my controller { } ?> my model { } app.php it shows this error Fatal error: Uncaught ArgumentCountError: Too few arguments to function product::index(), 0 passed in C:xampphtdocshermesmvccoreapp.php on line 40 and exactly 1 expected in C:xampphtdocshermesmvccontrollsproduct.php:14 Stack trace: #0 C:xampphtdocshermesmvccoreapp.php(40): product->index() #1 C:xampphtdocshermesmvcindex.php(9): App->__construct() #2 {main} thrown in C:xampphtdocshermesmvccontrollsproduct.php on line 14 Answer Replace in your app.php $params=array_values($url); by

How view file get the variable from controller?

I’m a student and new to PHP. After searching a lot i still don’t understand how the view file got the variable from controller. I got the function view() from Controller.php class. And i got a HomeController.php Extends the Controller This is inn my calc.php view file. As you can see that the calc.php doesn’t require any file from Controller.php

how to return a button using controller response to html

in my laravel application i have defined some rules which is returned by controller here it is code i wnat in return it should also return a button <a href=”{{ route(‘edit.order’ , $order->id) }}” class=”btn btn-sm btn-primary”><i class=”fa fa-edit”></i>Edit Order</a> how i can return that button using controoller? Answer The simple solution would be to save the button HTML and

Advertisement