本文整理汇总了PHP中Nette\PhpGenerator\ClassType::getMethods方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassType::getMethods方法的具体用法?PHP ClassType::getMethods怎么用?PHP ClassType::getMethods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\PhpGenerator\ClassType
的用法示例。
在下文中一共展示了ClassType::getMethods方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterCompile
public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
$methods = $class->getMethods();
$init = $methods['initialize'];
$init->addBody('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\Controls\\SingleSelectFileChoicer::register();');
$init->addBody('vojtabiberle\\MediaStorage\\Bridges\\Nette\\Forms\\Controls\\MultiSelectFileChoicer::register();');
}
示例2: afterCompile
public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
$init = $class->getMethods()['initialize'];
$config = $this->validateConfig($this->defaults);
if ($config['paginatorTemplate']) {
$init->addBody('?::$defaultPaginationTemplate = ?;', [Settings::class, $config['paginatorTemplate']]);
}
}
示例3: afterCompile
/**
* @param Nette\PhpGenerator\ClassType $class
*/
public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
$methods = $class->getMethods();
$init = $methods['initialize'];
if ($this->getContainerBuilder()->hasDefinition($this->prefix('bar'))) {
$init->addBody('if ($this->parameters["debugMode"]) Tracy\\Debugger::getBar()->addPanel($this->getService(?));', [$this->prefix('bar')]);
}
}
示例4: afterCompile
public function afterCompile(ClassType $class)
{
$config = $this->validateConfig($this->defaults);
$methods = $class->getMethods();
$initialize = $methods['initialize'];
$initialize->addBody(TextOutput::class . '::register();');
$initialize->addBody(DatePicker::class . '::register();');
$initialize->addBody(DateTimePicker::class . '::register();');
$initialize->addBody(TagControl::class . '::register();');
$this->registerSelectBox($initialize, $config['country'], "addSelectCountry", $this->countryCodes);
$this->registerSelectBox($initialize, $config['locale'], "addSelectLocale", $this->localeCodes);
}
示例5: afterCompile
/**
* @param Nette\PhpGenerator\ClassType $class
*/
public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
$methods = $class->getMethods();
$init = $methods['initialize'];
$config = $this->getSettings();
if ($config['registration']['upload'] && class_exists('Nette\\Forms\\Form')) {
$init->addBody(Upload::class . '::register();');
}
if ($config['registration']['multiUpload'] && class_exists('Nette\\Forms\\Form')) {
$init->addBody(MultiUpload::class . '::register();');
}
if ($config['checkbox']['caption']) {
$init->addBody(Checkbox::class . '::$globalCaption = ?;', [$config['checkbox']['caption']]);
}
}
示例6: afterCompile
public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
$config = $this->validateConfig($this->defaults);
$init = $class->getMethods()['initialize'];
if ($config['recaptcha']['api']) {
$init->addBody('WebChemistry\\Forms\\Controls\\Recaptcha::$defaultApiKey = ?;', [$config['recaptcha']['api']]);
}
if ($config['recaptcha']['secret']) {
$init->addBody('WebChemistry\\Forms\\Controls\\Recaptcha::$defaultSecretKey = ?;', [$config['recaptcha']['secret']]);
}
if ($config['date']['format']) {
$init->addBody('WebChemistry\\Forms\\Controls\\Date::$dateFormat = ?;', [$config['date']['format']]);
}
if ($config['translations']['enable']) {
$tr = $config['translations'];
$init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Date::VALID] = ?;', [$tr['date']]);
$init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Mask::VALID] = ?;', [$tr['mask']]);
$init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Recaptcha::VALID] = ?;', [$tr['recaptcha']['valid']]);
$init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Recaptcha::FILLED] = ?;', [$tr['recaptcha']['filled']]);
$init->addBody('Nette\\Forms\\Validator::$messages[WebChemistry\\Forms\\Controls\\Tags::PLACEHOLDER] = ?;', [$tr['tags']]);
}
}
示例7: afterCompile
public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
$init = $class->getMethods()['initialize'];
$config = $this->validateConfig($this->defaults);
$init->addBody('WebChemistry\\Forms\\Controls\\Multiplier::register(?);', [$config['name']]);
}
示例8: afterCompile
public function afterCompile(ClassType $class)
{
$init = $class->getMethods()['initialize'];
$init->addBody(__CLASS__ . '::registerControls();');
}
示例9: afterCompile
public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
$methods = $class->getMethods();
$methods['initialize']->addBody('$this->getByType(?)->register(?);', [Manager::class, $this->config['prepend']]);
}