1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6: */
7:
8: namespace Nette\Application;
9:
10: use Nette;
11:
12:
13: /**
14: * Application helpers.
15: */
16: class Helpers
17: {
18: use Nette\StaticClass;
19:
20: /**
21: * Splits name into [module, presenter] or [presenter, action]
22: * @return array
23: */
24: public static function splitName($name)
25: {
26: $pos = strrpos($name, ':');
27: return $pos === false
28: ? ['', $name, '']
29: : [substr($name, 0, $pos), (string) substr($name, $pos + 1), ':'];
30: }
31: }
32: