Gc\View\Helper\ModulePlugin::has PHP Méthode

has() public méthode

Check if plugin exists
public has ( string $moduleName, string $pluginName = null ) : boolean
$moduleName string Module name
$pluginName string Plugin name
Résultat boolean
    public function has($moduleName, $pluginName = null)
    {
        if (is_array($moduleName)) {
            list($moduleName, $pluginName) = $moduleName;
        } else {
            $pluginName = $this->toCamelCase($pluginName);
        }
        if ($this->canCreate($moduleName, $pluginName)) {
            return true;
        }
        return false;
    }

Usage Example

Exemple #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testHas()
 {
     $this->object->get('Blog', 'CommentForm');
     $this->assertTrue($this->object->has('Blog', 'CommentForm'));
     $this->assertTrue($this->object->has(array('Blog', 'CommentForm')));
 }