fixed sitemap bug

master
A1Gard 3 days ago
parent ed4d58bd4d
commit 9099bdc105

@ -642,39 +642,57 @@ class ClientController extends Controller
public function sitemap() public function sitemap()
{ {
header('content-type: text/xml'); $xmlContent = '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL;
echo '<? xml version = "1.0" encoding = "utf-8" ?>'.PHP_EOL; $xmlContent .= view('website.sitemaps.sitemap')->render(); // Render the view and append to XML content
return view('website.sitemaps.sitemap');
// Return the XML response
return response($xmlContent, 200)
->header('Content-Type', 'text/xml');
} }
public function sitemapPosts() public function sitemapPosts()
{ {
header('content-type: text/xml'); $xmlContent = '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL;
echo '<? xml version = "1.0" encoding = "utf-8" ?>'.PHP_EOL; $xmlContent .= view('website.sitemaps.sitemap-posts')->render(); // Render the view and append to XML content
return view('website.sitemaps.sitemap-posts');
// Return the XML response
return response($xmlContent, 200)
->header('Content-Type', 'text/xml');
} }
public function sitemapProducts() public function sitemapProducts()
{ {
header('content-type: text/xml'); $xmlContent = '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL;
echo '<? xml version = "1.0" encoding = "utf-8" ?>'.PHP_EOL; $xmlContent .= view('website.sitemaps.sitemap-products')->render(); // Render the view and append to XML content
return view('website.sitemaps.sitemap-products');
// Return the XML response
return response($xmlContent, 200)
->header('Content-Type', 'text/xml');
} }
public function sitemapClips() public function sitemapClips()
{ {
header('content-type: text/xml'); $xmlContent = '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL;
echo '<? xml version = "1.0" encoding = "utf-8" ?>'.PHP_EOL; $xmlContent .= view('website.sitemaps.sitemap-clips')->render(); // Render the view and append to XML content
return view('website.sitemaps.sitemap-clips');
// Return the XML response
return response($xmlContent, 200)
->header('Content-Type', 'text/xml');
} }
public function sitemapGalleries() public function sitemapGalleries()
{ {
header('content-type: text/xml'); $xmlContent = '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL;
echo '<? xml version = "1.0" encoding = "utf-8" ?>'.PHP_EOL; $xmlContent .= view('website.sitemaps.sitemap-gallries')->render(); // Render the view and append to XML content
return view('website.sitemaps.sitemap-gallries');
// Return the XML response
return response($xmlContent, 200)
->header('Content-Type', 'text/xml');
} }
public function sitemapAttachments() public function sitemapAttachments()
{ {
header('content-type: text/xml'); $xmlContent = '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL;
echo '<? xml version = "1.0" encoding = "utf-8" ?>'.PHP_EOL; $xmlContent .= view('website.sitemaps.sitemap-attachments')->render(); // Render the view and append to XML content
return view('website.sitemaps.sitemap-attachments');
// Return the XML response
return response($xmlContent, 200)
->header('Content-Type', 'text/xml');
} }
public function lang(Request $request) public function lang(Request $request)

Loading…
Cancel
Save