當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Callback::invokeArgs方法代碼示例

本文整理匯總了PHP中Nette\Callback::invokeArgs方法的典型用法代碼示例。如果您正苦於以下問題:PHP Callback::invokeArgs方法的具體用法?PHP Callback::invokeArgs怎麽用?PHP Callback::invokeArgs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Nette\Callback的用法示例。


在下文中一共展示了Callback::invokeArgs方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: attached

 public function attached($presenter)
 {
     parent::attached($presenter);
     $this->column = $this->lookup('Brabijan\\Datagrid\\Renderer')->getColumn($this->columnId);
     if ($this->templateRowCallback) {
         $this->templateRowCallback->invokeArgs(array($this));
     }
 }
開發者ID:brabijan,項目名稱:datagrid,代碼行數:8,代碼來源:Column.php

示例2: run

 /**
  * @return Nette\Application\IResponse
  */
 public function run(Application\Request $request)
 {
     $this->request = $request;
     $httpRequest = $this->context->getByType('Nette\\Http\\IRequest');
     if (!$httpRequest->isAjax() && ($request->isMethod('get') || $request->isMethod('head'))) {
         $refUrl = clone $httpRequest->getUrl();
         $url = $this->context->getService('router')->constructUrl($request, $refUrl->setPath($refUrl->getScriptPath()));
         if ($url !== NULL && !$httpRequest->getUrl()->isEqual($url)) {
             return new Responses\RedirectResponse($url, Http\IResponse::S301_MOVED_PERMANENTLY);
         }
     }
     $params = $request->getParameters();
     if (!isset($params['callback'])) {
         throw new Application\BadRequestException("Parameter callback is missing.");
     }
     $params['presenter'] = $this;
     $callback = new Nette\Callback($params['callback']);
     $response = $callback->invokeArgs(Application\UI\PresenterComponentReflection::combineArgs($callback->toReflection(), $params));
     if (is_string($response)) {
         $response = array($response, array());
     }
     if (is_array($response)) {
         if ($response[0] instanceof \SplFileInfo) {
             $response = $this->createTemplate('Nette\\Templating\\FileTemplate')->setParameters($response[1])->setFile($response[0]);
         } else {
             $response = $this->createTemplate('Nette\\Templating\\Template')->setParameters($response[1])->setSource($response[0]);
         }
     }
     if ($response instanceof Nette\Templating\ITemplate) {
         return new Responses\TextResponse($response);
     } else {
         return $response;
     }
 }
開發者ID:svobodni,項目名稱:web,代碼行數:37,代碼來源:MicroPresenter.php

示例3: render

 public function render()
 {
     if ($this->customTemplate === NULL) {
         $this->template->setFile(__DIR__ . '/control.latte');
     } else {
         $this->template->setFile($this->customTemplate);
         $this->template->extend = __DIR__ . '/control.latte';
     }
     $this->template->rows = array_keys($this->getData());
     if ($this->isPaginatorEnabled()) {
         $this->template->paginationPosition = $this->paginationPositions;
         $this->template->paginator = $this->paginator;
     } else {
         $this->template->paginationPosition = Renderer::PAGINATION_NONE;
     }
     if ($this->templateHelpersCallback) {
         $this->templateHelpersCallback->invokeArgs(array($this->template));
     }
     $this->template->showFilter = ($this->filterManualRender == FALSE and $this->filterFormFactory !== NULL);
     $this->template->showHeaders = !$this->hideDatagridHeaders;
     $this->template->render();
 }
開發者ID:brabijan,項目名稱:datagrid,代碼行數:22,代碼來源:Renderer.php

示例4: callMethod

 /**
  * Calls method using autowiring.
  * @param  mixed   class, object, function, callable
  * @param  array   arguments
  * @return mixed
  */
 public function callMethod($function, array $args = array())
 {
     $callback = new Nette\Callback($function);
     return $callback->invokeArgs(Helpers::autowireArguments($callback->toReflection(), $args, $this));
 }
開發者ID:vrtak-cz,項目名稱:nette-doctrine-sandbox,代碼行數:11,代碼來源:Container.php

示例5: expandEventCallback

 /**
  * Expands the event to the callback.
  *
  * @param \Nette\Callback $callback Original callback
  * @param \ApiGen\Event $event Event
  * @return mixed
  */
 public static function expandEventCallback(Callback $callback, Event $event)
 {
     $payload = $event->getPayload();
     $arguments = is_array($payload) ? $payload : (null === $payload ? array() : array($payload));
     $arguments[] = $event;
     return $callback->invokeArgs($arguments);
 }
開發者ID:memopower,項目名稱:cakephp-api-docs,代碼行數:14,代碼來源:EventDispatcher.php


注:本文中的Nette\Callback::invokeArgs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。