-
Notifications
You must be signed in to change notification settings - Fork 11
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 #8 from EvgenyGavrilov/master
disallow urls
- Loading branch information
Showing
7 changed files
with
154 additions
and
5 deletions.
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
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
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,14 @@ | ||
DROP TABLE IF EXISTS `category`; | ||
|
||
CREATE TABLE `category` ( | ||
`id` int(10) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(50) DEFAULT NULL, | ||
`slug` varchar(50) DEFAULT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=1; | ||
|
||
INSERT INTO `category` (`name`, `slug`) | ||
VALUES | ||
('Category 1', 'category_1'), | ||
('Category 2', 'category_2'), | ||
('Category 3', 'category_3'); |
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,49 @@ | ||
<?php | ||
namespace zhelyabuzhsky\sitemap\tests\models; | ||
|
||
use yii\db\ActiveRecord; | ||
use zhelyabuzhsky\sitemap\models\SitemapEntityInterface; | ||
|
||
class Category extends ActiveRecord implements SitemapEntityInterface | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getSitemapLastmod() | ||
{ | ||
return date('c'); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getSitemapChangefreq() | ||
{ | ||
return 'daily'; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getSitemapPriority() | ||
{ | ||
return 0.5; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getSitemapLoc() | ||
{ | ||
return 'http://localhost/' . $this->slug; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function getSitemapDataSource() | ||
{ | ||
return self::find(); | ||
} | ||
} |