Skip to content

Instantly share code, notes, and snippets.

@tigrang
Created January 19, 2012 21:23
Show Gist options
  • Save tigrang/1642750 to your computer and use it in GitHub Desktop.
Save tigrang/1642750 to your computer and use it in GitHub Desktop.
<?php
public function pluginSplit($name, $fallback = true) {
$plugin = null;
list($first, $second) = pluginSplit($name);
if (CakePlugin::loaded($first) === true) {
$name = $second;
$plugin = $first;
}
if (isset($this->plugin) && !$plugin && $fallback) {
$plugin = $this->plugin;
}
return array($plugin, $name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment