jeudi 25 octobre 2018

How can i use "prep_url" from codeidniter inside my View in Laravel?

I add the function "prep_url" from codeigniter to my laravel project like here:

Laravel add http to urls

If I do it in my Controller like this:

$website = example.com;
$url = prep_url($website);

and then in my view i can do it like this:



it shows me this: http://example.com

so everything works :)

but i have a problem

I have the table users and there all users have a website

in my controller i do it like this:

$user = DB::table('users')->get();
return view('user/einzelansicht' ['user' => $user] );

and in my view i can show my user with




how can i use prep_url here?

because i already did this in my view:



but it tells me simicolons are not allowed and without the simicolon it does not work

then i tried in my controler this:

$website = $user->website;
$url = prep_url($website);

but this doesnt work too

so how can i do this? does anyone know?

thank you for your help! :)))




Aucun commentaire:

Enregistrer un commentaire