UI\Multiplier a tvorba jmen komponent – proc se vygeneruje jen cislo?

Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
Ja
Člen | 260
+
0
-

Zdravim,
hraju si zde s paypal tlacitkem a jeho multiplikaci pro ruzne ceny. Uvnitr komponenty se tvori link pres $this->presenter->link($this->name . „:${signal}!“);

Jenomze $this->name obsahuje pouze ‚1‘, misto ‚paypalButton-1‘ coz vyusti v chybu: Component with name ‚1‘ does not exist.

Neni to bug?

Tvorba komponenty:

<?php
	protected function createComponentPaypalButton()
    {
        // ... neco
        return new Nette\Application\UI\Multiplier(function ($id) use ($prices) {
            return $this->getPaypalButtonComponent($prices[$id]);
        });
    }
?>

Zde je dump, name je az uplne dole:

<?php
Seberm\Components\PayPal\Buttons\Order #6943
onConfirmation => Kdyby\Events\Event #d9a2
currencyCode => "EUR" (3)
paymentType => "Order" (5)
amount => NULL
tax => NULL
shipping => NULL
api protected => Seberm\PayPal\API\API #646f
cart private => array (1)
0 => array (4) [ ... ]
data private => array (5)
proxyHost => "127.0.0.1" (9)
proxyPort => "808" (3)
username => "seberm_1332081338_biz_api1.gmail.com" (36)
password => "1332081363" (10)
signature => "AWiH1IO0zFZrEQbbn0JwDZHbWukIAebmYjpOylRCqBGGgztea2bku.N4" (56)
sandbox private => TRUE
useProxy private => FALSE
token private => NULL
translator protected => NULL
session protected => Nette\Http\SessionSection #1f2b
session private => Nette\Http\Session #8964
regenerated private => NULL
options private => array (14) [ ... ]
request private => Nette\Http\Request #7d29 { ... }
response private => Nette\Http\Response #6693 { ... }
handler private => NULL
name private => "paypal" (6)
data private => NULL
meta private => FALSE
warnOnUndefined => FALSE
onSuccessPayment => Kdyby\Events\Event #871a
onCancel => Kdyby\Events\Event #b36a
onError => Kdyby\Events\Event #5bef
templateFactory private => NULL
template private => NULL
invalidSnippets private => array ()
snippetMode => NULL
params protected => array ()
components private => array (1)
button => Nette\Application\UI\Form #3986
cloning private => NULL
parent private => Nette\Application\UI\Multiplier #1083
name private => "1"
monitors private => array (1)
"Nette\Application\UI\Presenter" => array (4)
0 => App\FrontModule\Presenters\OrderPresenter #f0a1 { ... }
1 => 2
2 => "paypalButton-1" (13)
3 => TRUE

?>

Moc diky.

Ja

Editoval Ja (13. 9. 2015 17:01)

David Matějka
Moderator | 6445
+
0
-

To, ze name obsahuje pouze 1 je spravne. Pokud chces kompletni cestu k presenteru, pouzij getUniqueId

Ja
Člen | 260
+
0
-

Je to tam, moc diky, ja ti snad budu muset vyhledove zacit posilat nejaky donations :)))