Welcome Guest, Not a member yet? Register   Sign In
view not loaded in second function
#1

I can't explian why the profile() function just ends up in a white page.
Could someone explain or give me a hint to check for something?
PHP Code:
Routes:

$routes->group('employee', static function ($routes) {
    $routes->get('/''Org\Employee::index');
    $routes->get('profile''Org\Employee::profile');
    });

Controller
Code:
namespace App\Controllers\Org;
use App\Controllers\BaseController;

class Employee extends BaseController
{
public function index()  // perfectly working!
    {
        $data = [];
$data['title'] = 'my profile';
$data['heading'] = 'user data:';
$data['view']     = 'dashboard1';
    echo view('design1/template', $data);
        //return redirect()->to(base_url());
    }
   
public function profile()  // just a white page
    { 
        // echo "test route successfull!";  /* (route tested: working!)
        $data = [];
$data['title'] = 'my profile';
$data['heading'] = 'user data:';
$data['view']     = 'dashboard1';
    echo view('design1/template', $data);
    }
}
Reply


Messages In This Thread
view not loaded in second function - by JanFromHamburg - 05-26-2023, 07:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB