Sitemap Generator in Yii

I have created a simple and basic XML sitemap generator.

Check it out at

I would like to make changes as per your feedback

Thanks :)

Nice work, I submitted a test request.

a few suggestions:

other than that, looks pretty solid.

Both of your suggestions will be incorporated. Thank you.

I have about 100,000 URLs from one website.

My problem is, it takes couple of minutes to get the data. I think it is taking longer at pagination. All indexes added. However, the first page loads fast. Any idea how I can make this efficient. I am using InnoDB

	public function actionSitemapLinks()


		$condition = 'off=0';

		$this->getHulkLinks($condition, $redir='SitemapLinks');


	private function getHulkLinks($condition, $redir)


		$HR = $this->getValidHR();

		$name = $HR->name;


		$criteria=new CDbCriteria;

	    $criteria->condition = $condition.' AND rid='.$HR->id;;

		$criteria->order     = 'h_level, url, h_order, pid';

		$pages=new CPagination(hulk_links::model()->count($criteria));


		if ($_GET['cp']) $pages->currentPage=$_GET['cp'];



		$sort=new CSort('hulk_links');





		if ($redir==ErrorLinks)





Thanks for testing this tools. I had tested with small site only. The two huge request submits gave me opportunity to sort out some bugs. The pagination is now faster after dropping the order clause.

  • Fixed with a quick patch

Got this error

Alias "application.components.email_template.Email_template" is invalid. Make sure it points to an existing PHP file.