href returning another URLConvert from MySQL datetime to another format with PHPSaving image from PHP URLCan't use method return value in write contextIs there a function to make a copy of a PHP array to another?Returning JSON from a PHP ScriptGet the full URL in PHPLaravel: Get base urlHow to avoid displaying jos-Error in contact categories?Laravel routes in Shared Hosting not works properlyBuilding a Dynamic Menu Based On Laravel 5 Models & Blade Templates
New Site Design!
Why did Robert pick unworthy men for the White Cloaks?
How long would it take for sucrose to undergo hydrolysis in boiling water?
Would a bit of grease on overhead door cables or bearings cause the springs to break?
What does the "titan" monster tag mean?
Can a 40amp breaker be used safely and without issue with a 40amp device on 6AWG wire?
Dedicated bike GPS computer over smartphone
I received a gift from my sister who just got back from
My players want to use called-shots on Strahd
Why are backslashes included in this shell script?
SFDX force:org:clone not working
How can I find out about the game world without meta-influencing it?
Why is Skinner so awkward in Hot Fuzz?
Integrate without expansion?
Do Veracrypt encrypted volumes have any kind of brute force protection?
Why does there seem to be an extreme lack of public trashcans in Taiwan?
Should I move out from my current apartment before the contract ends to save more money?
The best in flight meal option for those suffering from reflux
How to represent jealousy in a cute way?
Is it a good security practice to force employees hide their employer to avoid being targeted?
Short story about psychologist analyzing demon
Opposite of "Concerto Grosso"?
Should I worry about having my credit pulled multiple times while car shopping?
Why is it bad to use your whole foot in rock climbing
href returning another URL
Convert from MySQL datetime to another format with PHPSaving image from PHP URLCan't use method return value in write contextIs there a function to make a copy of a PHP array to another?Returning JSON from a PHP ScriptGet the full URL in PHPLaravel: Get base urlHow to avoid displaying jos-Error in contact categories?Laravel routes in Shared Hosting not works properlyBuilding a Dynamic Menu Based On Laravel 5 Models & Blade Templates
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
After I click in the menu navigation (for exemple href='home') when i am in the view .../public/single/1 they send me to .../public/single/home and not .../public/home
Here is my code:
MENU LIST
<div class="header_content d-flex flex-row align-items-center justify-content-start">
<div class="logo"><a href="#"><span>m</span>a <span> B</span>ibli<span>o</span></a></div>
<nav class="main_nav">
<ul class="d-flex flex-row align-items-start justify-content-start">
<li class="$home"><a href="home">Acceuil</a></li>
<li class="$about"><a href="about">About us</a></li>
<li class="$listing"><a href="listing">Produits</a></li>
<li class="$blog"><a href="blog">Nouveauté</a></li>
<li class="$contact"><a href="contact">Contactez nous!</a></li>
</ul>
</nav>
<div class="submit ml-auto"><a href="#">Recherche >></a></div>
<div class="hamburger ml-auto"><i class="fa fa-bars" aria-hidden="true"></i></div>
</div>
</div>
WEB.PHP
Route::get('/single/id','AnnonceController@annonce');
Route::get('/home','PagesController@home');
Route::resource('home','AnnonceController');
And this is my controller:
public function annonce($id)
$annonce = DB::table('annonce')
->join('article', 'annonce.ID_ANNONCE', '=', 'article.ID_ANNONCE')
->join('photo_articles', 'photo_articles.ID_ARTICLE', '=', 'article.ID_ARTICLE')
->select('annonce.*', 'article.NOM_ARTICLE','PHOTO_ARTICLE')
->where('annonce.ID_ANNONCE',$id)
->get();
return view('single')->with('annonce',$annonce);
php laravel
add a comment |
After I click in the menu navigation (for exemple href='home') when i am in the view .../public/single/1 they send me to .../public/single/home and not .../public/home
Here is my code:
MENU LIST
<div class="header_content d-flex flex-row align-items-center justify-content-start">
<div class="logo"><a href="#"><span>m</span>a <span> B</span>ibli<span>o</span></a></div>
<nav class="main_nav">
<ul class="d-flex flex-row align-items-start justify-content-start">
<li class="$home"><a href="home">Acceuil</a></li>
<li class="$about"><a href="about">About us</a></li>
<li class="$listing"><a href="listing">Produits</a></li>
<li class="$blog"><a href="blog">Nouveauté</a></li>
<li class="$contact"><a href="contact">Contactez nous!</a></li>
</ul>
</nav>
<div class="submit ml-auto"><a href="#">Recherche >></a></div>
<div class="hamburger ml-auto"><i class="fa fa-bars" aria-hidden="true"></i></div>
</div>
</div>
WEB.PHP
Route::get('/single/id','AnnonceController@annonce');
Route::get('/home','PagesController@home');
Route::resource('home','AnnonceController');
And this is my controller:
public function annonce($id)
$annonce = DB::table('annonce')
->join('article', 'annonce.ID_ANNONCE', '=', 'article.ID_ANNONCE')
->join('photo_articles', 'photo_articles.ID_ARTICLE', '=', 'article.ID_ARTICLE')
->select('annonce.*', 'article.NOM_ARTICLE','PHOTO_ARTICLE')
->where('annonce.ID_ANNONCE',$id)
->get();
return view('single')->with('annonce',$annonce);
php laravel
That is how relative URLs work. See laravel.com/docs/5.8/urls for how to generate accurate URLs for your app
– Phil
Mar 25 at 4:26
add a comment |
After I click in the menu navigation (for exemple href='home') when i am in the view .../public/single/1 they send me to .../public/single/home and not .../public/home
Here is my code:
MENU LIST
<div class="header_content d-flex flex-row align-items-center justify-content-start">
<div class="logo"><a href="#"><span>m</span>a <span> B</span>ibli<span>o</span></a></div>
<nav class="main_nav">
<ul class="d-flex flex-row align-items-start justify-content-start">
<li class="$home"><a href="home">Acceuil</a></li>
<li class="$about"><a href="about">About us</a></li>
<li class="$listing"><a href="listing">Produits</a></li>
<li class="$blog"><a href="blog">Nouveauté</a></li>
<li class="$contact"><a href="contact">Contactez nous!</a></li>
</ul>
</nav>
<div class="submit ml-auto"><a href="#">Recherche >></a></div>
<div class="hamburger ml-auto"><i class="fa fa-bars" aria-hidden="true"></i></div>
</div>
</div>
WEB.PHP
Route::get('/single/id','AnnonceController@annonce');
Route::get('/home','PagesController@home');
Route::resource('home','AnnonceController');
And this is my controller:
public function annonce($id)
$annonce = DB::table('annonce')
->join('article', 'annonce.ID_ANNONCE', '=', 'article.ID_ANNONCE')
->join('photo_articles', 'photo_articles.ID_ARTICLE', '=', 'article.ID_ARTICLE')
->select('annonce.*', 'article.NOM_ARTICLE','PHOTO_ARTICLE')
->where('annonce.ID_ANNONCE',$id)
->get();
return view('single')->with('annonce',$annonce);
php laravel
After I click in the menu navigation (for exemple href='home') when i am in the view .../public/single/1 they send me to .../public/single/home and not .../public/home
Here is my code:
MENU LIST
<div class="header_content d-flex flex-row align-items-center justify-content-start">
<div class="logo"><a href="#"><span>m</span>a <span> B</span>ibli<span>o</span></a></div>
<nav class="main_nav">
<ul class="d-flex flex-row align-items-start justify-content-start">
<li class="$home"><a href="home">Acceuil</a></li>
<li class="$about"><a href="about">About us</a></li>
<li class="$listing"><a href="listing">Produits</a></li>
<li class="$blog"><a href="blog">Nouveauté</a></li>
<li class="$contact"><a href="contact">Contactez nous!</a></li>
</ul>
</nav>
<div class="submit ml-auto"><a href="#">Recherche >></a></div>
<div class="hamburger ml-auto"><i class="fa fa-bars" aria-hidden="true"></i></div>
</div>
</div>
WEB.PHP
Route::get('/single/id','AnnonceController@annonce');
Route::get('/home','PagesController@home');
Route::resource('home','AnnonceController');
And this is my controller:
public function annonce($id)
$annonce = DB::table('annonce')
->join('article', 'annonce.ID_ANNONCE', '=', 'article.ID_ANNONCE')
->join('photo_articles', 'photo_articles.ID_ARTICLE', '=', 'article.ID_ARTICLE')
->select('annonce.*', 'article.NOM_ARTICLE','PHOTO_ARTICLE')
->where('annonce.ID_ANNONCE',$id)
->get();
return view('single')->with('annonce',$annonce);
php laravel
php laravel
edited Mar 25 at 4:24
Udhav Sarvaiya
2,82392132
2,82392132
asked Mar 25 at 1:53
Othmane MessaoudOthmane Messaoud
114
114
That is how relative URLs work. See laravel.com/docs/5.8/urls for how to generate accurate URLs for your app
– Phil
Mar 25 at 4:26
add a comment |
That is how relative URLs work. See laravel.com/docs/5.8/urls for how to generate accurate URLs for your app
– Phil
Mar 25 at 4:26
That is how relative URLs work. See laravel.com/docs/5.8/urls for how to generate accurate URLs for your app
– Phil
Mar 25 at 4:26
That is how relative URLs work. See laravel.com/docs/5.8/urls for how to generate accurate URLs for your app
– Phil
Mar 25 at 4:26
add a comment |
2 Answers
2
active
oldest
votes
It's happening because you giving href='home' which will add to your current URL , which means you are on single/1(route parameter) and when you click it will become single/home(parameter).
so give the full path.
I suggest you should use the route function of laravel and also give the name to your route like below
Route::get('/home','PagesController@home')->name('myhome');
see Documentation for naming route.
then call this in your blade like thisroute('myhome')
add a comment |
You return statement should be like this return view('single',['id' => $id])->with('annonce',$annonce);
Note: Please use relationship in Laravel instead of DB::table
public function annonce($id)
$annonce = DB::table('annonce')
->join('article', 'annonce.ID_ANNONCE', '=', 'article.ID_ANNONCE')
->join('photo_articles', 'photo_articles.ID_ARTICLE', '=', 'article.ID_ARTICLE')
->select('annonce.*', 'article.NOM_ARTICLE','PHOTO_ARTICLE')
->where('annonce.ID_ANNONCE',$id)
->get();
return view('single',['id' => $id])->with('annonce',$annonce);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330369%2fhref-returning-another-url%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
It's happening because you giving href='home' which will add to your current URL , which means you are on single/1(route parameter) and when you click it will become single/home(parameter).
so give the full path.
I suggest you should use the route function of laravel and also give the name to your route like below
Route::get('/home','PagesController@home')->name('myhome');
see Documentation for naming route.
then call this in your blade like thisroute('myhome')
add a comment |
It's happening because you giving href='home' which will add to your current URL , which means you are on single/1(route parameter) and when you click it will become single/home(parameter).
so give the full path.
I suggest you should use the route function of laravel and also give the name to your route like below
Route::get('/home','PagesController@home')->name('myhome');
see Documentation for naming route.
then call this in your blade like thisroute('myhome')
add a comment |
It's happening because you giving href='home' which will add to your current URL , which means you are on single/1(route parameter) and when you click it will become single/home(parameter).
so give the full path.
I suggest you should use the route function of laravel and also give the name to your route like below
Route::get('/home','PagesController@home')->name('myhome');
see Documentation for naming route.
then call this in your blade like thisroute('myhome')
It's happening because you giving href='home' which will add to your current URL , which means you are on single/1(route parameter) and when you click it will become single/home(parameter).
so give the full path.
I suggest you should use the route function of laravel and also give the name to your route like below
Route::get('/home','PagesController@home')->name('myhome');
see Documentation for naming route.
then call this in your blade like thisroute('myhome')
answered Mar 25 at 5:02
Karan SadanaKaran Sadana
77938
77938
add a comment |
add a comment |
You return statement should be like this return view('single',['id' => $id])->with('annonce',$annonce);
Note: Please use relationship in Laravel instead of DB::table
public function annonce($id)
$annonce = DB::table('annonce')
->join('article', 'annonce.ID_ANNONCE', '=', 'article.ID_ANNONCE')
->join('photo_articles', 'photo_articles.ID_ARTICLE', '=', 'article.ID_ARTICLE')
->select('annonce.*', 'article.NOM_ARTICLE','PHOTO_ARTICLE')
->where('annonce.ID_ANNONCE',$id)
->get();
return view('single',['id' => $id])->with('annonce',$annonce);
add a comment |
You return statement should be like this return view('single',['id' => $id])->with('annonce',$annonce);
Note: Please use relationship in Laravel instead of DB::table
public function annonce($id)
$annonce = DB::table('annonce')
->join('article', 'annonce.ID_ANNONCE', '=', 'article.ID_ANNONCE')
->join('photo_articles', 'photo_articles.ID_ARTICLE', '=', 'article.ID_ARTICLE')
->select('annonce.*', 'article.NOM_ARTICLE','PHOTO_ARTICLE')
->where('annonce.ID_ANNONCE',$id)
->get();
return view('single',['id' => $id])->with('annonce',$annonce);
add a comment |
You return statement should be like this return view('single',['id' => $id])->with('annonce',$annonce);
Note: Please use relationship in Laravel instead of DB::table
public function annonce($id)
$annonce = DB::table('annonce')
->join('article', 'annonce.ID_ANNONCE', '=', 'article.ID_ANNONCE')
->join('photo_articles', 'photo_articles.ID_ARTICLE', '=', 'article.ID_ARTICLE')
->select('annonce.*', 'article.NOM_ARTICLE','PHOTO_ARTICLE')
->where('annonce.ID_ANNONCE',$id)
->get();
return view('single',['id' => $id])->with('annonce',$annonce);
You return statement should be like this return view('single',['id' => $id])->with('annonce',$annonce);
Note: Please use relationship in Laravel instead of DB::table
public function annonce($id)
$annonce = DB::table('annonce')
->join('article', 'annonce.ID_ANNONCE', '=', 'article.ID_ANNONCE')
->join('photo_articles', 'photo_articles.ID_ARTICLE', '=', 'article.ID_ARTICLE')
->select('annonce.*', 'article.NOM_ARTICLE','PHOTO_ARTICLE')
->where('annonce.ID_ANNONCE',$id)
->get();
return view('single',['id' => $id])->with('annonce',$annonce);
answered Mar 25 at 4:29
Mayank DudakiyaMayank Dudakiya
886616
886616
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330369%2fhref-returning-another-url%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
That is how relative URLs work. See laravel.com/docs/5.8/urls for how to generate accurate URLs for your app
– Phil
Mar 25 at 4:26