本文整理匯總了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']]);
}