Skip to content

Instantly share code, notes, and snippets.

@marchampson
Created May 2, 2013 09:28
Show Gist options
  • Save marchampson/5501172 to your computer and use it in GitHub Desktop.
Save marchampson/5501172 to your computer and use it in GitHub Desktop.
Create prettyurls
$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