Created
May 2, 2013 09:28
-
-
Save marchampson/5501172 to your computer and use it in GitHub Desktop.
Create prettyurls
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
$adapter = $this->getServiceLocator()->get('Zend\Db\Adapter\Adapter'); | |
$results = $this->getPagesTable()->fetchAll(); | |
$textUtils = new Text; | |
foreach($results as $page) { | |
$prettyurl = $textUtils->prettyurl($page->name); | |
$sql = "update pages set prettyurl = '".$prettyurl."' where id = ".$page->id; | |
$adapter->query($sql, Adapter::QUERY_MODE_EXECUTE); | |
} | |
die('fin'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment