jeudi 27 août 2015

Creating dynamic labels in Laravel and passing variables to them

I have a form that creates a project. A project can have a few external links.

For example, it can have a link to Behance, deviantART, YouTube, Facebook and so on.

Some might not have any links at all.

If a project has Behance or deviantART or Facebook link, then when viewing the project, it should say:

View [project name] on [social network name].

If it has a link to YouTube, it should say:

Watch [project name] on YouTube.

And some other link can have custom 'labels' so to say.

Of course I could do an if statement, but I believe there's an easier way to do this using something like Lang maybe? The only thing I don't understand is - how can I pass that [project name] to the Lang option?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1JzHqSJ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire