PHP code example of cevin / laravel-multi-language
1. Go to this page and download the library: Download cevin/laravel-multi-language 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/ */
cevin / laravel-multi-language example snippets
class SomeController extends Controller
{
// For route: /{a}/{b}/{c}
// ❌ Method's parameter list is empty.
public function method()
{
$a = func_get_args()[0];
$b = func_get_args()[1];
$c = func_get_args()[2];
}
// For route: /{a}/{b}/{c}
// ❌ Parameter name does not match the variable name defined in the route.
public function method($aa, $bb, $cc)
{
// ....
}
// For route: /{a}/{b}/{c}
// ❗️ The number of parameters does not match the number of variables defined in the route.
public function method($a, $b)
{
$c = func_get_args()[2];
}
// For route: /{a}/{b}/{c}
// ✅
public function method($a, $b, $c)
{
// .....
}
// For route: /{a}/{b}/{c}
// ✅
public function method($c, $a, $b)
{
return $c.'-'.$a.'-'.$b;
// /a/b/c
// output: c-a-b
}
}