This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from samsonasik/feature/seo
implement feature #59 : more seo
- Loading branch information
Showing
8 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
module/Application/src/Application/Controller/SitemapController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Application\Controller; | ||
|
||
use Zend\Mvc\Controller\AbstractActionController; | ||
use Zend\View\Model\ViewModel; | ||
|
||
/** | ||
* Get sitemap page | ||
*/ | ||
class SitemapController extends AbstractActionController | ||
{ | ||
public function indexAction() | ||
{ | ||
$this->getResponse()->getHeaders()->addHeaderLine('Content-Type', 'text/xml'); | ||
|
||
$viewModel = new ViewModel(); | ||
$viewModel->setTerminal(true); | ||
|
||
return $viewModel; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
module/Application/test/ApplicationTest/Controller/SitemapControllerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace ApplicationTest\Controller; | ||
|
||
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; | ||
|
||
class SitemapControllerTest extends AbstractHttpControllerTestCase | ||
{ | ||
public function setUp() | ||
{ | ||
$this->setApplicationConfig( | ||
include dirname(dirname(dirname(dirname(dirname(__DIR__))))).'/config/application.config.php' | ||
); | ||
parent::setUp(); | ||
} | ||
|
||
public function testGetXmlPage() | ||
{ | ||
$this->dispatch('/sitemapxml'); | ||
$this->assertResponseStatusCode(200); | ||
|
||
$this->assertModuleName('Application'); | ||
$this->assertControllerName('Application\Controller\Sitemap'); | ||
$this->assertControllerClass('SitemapController'); | ||
$this->assertMatchedRouteName('sitemapxml'); | ||
|
||
$this->assertEquals('Content-Type: text/xml', $this->getResponseHeader('Content-Type')->toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php echo $this->navigation('navigation') | ||
->sitemap() | ||
->setServerUrl('http://learnzf2.sitrun-tech.com/') | ||
->setFormatOutput(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
User-agent: * | ||
Allow: / |