Hi:
I have this view:
$post->user->name
I can call it in the post page successfully
Now i need to assign that value into the main template template into a new var, but it doesn't work.
Something like this:
<?php
$metaAuthorName = "($post->user->name)";
?>
How can i pass this value to the new var? Thank you
You need to do like this
<?php
$metaAuthorName = $post->user->name;
?>
If you do with " " , you will save "($post->user->name)" in $metaAuthorName, but if you do $metaAuthorName = $post->user->name you will save the value of $post->user->name into $metaAuthorName
dormidosan said:
You need to do like this
<?php $metaAuthorName = $post->user->name; ?>
If you do with " " , you will save "($post->user->name)" in $metaAuthorName, but if you do $metaAuthorName = $post->user->name you will save the value of $post->user->name into $metaAuthorName
Thanks , this work perfect.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community