Skip to content

Instantly share code, notes, and snippets.

@ludofleury
Created June 6, 2011 08:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ludofleury/1009919 to your computer and use it in GitHub Desktop.
Save ludofleury/1009919 to your computer and use it in GitHub Desktop.
Use multiple routing files.
## Default rules ===============================================================
homepage:
url: /
param:
module: home
action: index
sf_format: html
<?php foreach(glob(dirname(__FILE__).DIRECTORY_SEPARATOR.'routing'.DIRECTORY_SEPARATOR.'*.yml') as $yml){ require($yml); echo "\n"; } ?>
@dator-zz
Copy link

dator-zz commented Jun 6, 2011

I think it's better to use :

<?php foreach(glob(dirname(__FILE__).DIRECTORY_SEPARATOR.'routing'.DIRECTORY_SEPARATOR.'*.yml') as $yml){ require($yml); echo "\n"; }?>

require is faster than require_once and echo "\n"; is there to enforce new line :)

@ludofleury
Copy link
Author

Your tips on "\n" is awesome, I had some prob which forced me to make the new line into my separate routing files ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment