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


PHP Application::on方法代碼示例

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


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

示例1: prepareView

 /**
  * Prepare form for display
  * @param App $app
  * @param \Bixie\Formmaker\FormmakerModule $formmaker
  */
 public function prepareView($app, $formmaker)
 {
     if ($this->get('recaptcha') && $formmaker->config('recaptha_secret_key')) {
         $app->on('view.footer', function ($event) {
             $event->addResult('<script src="https://www.google.com/recaptcha/api.js?onload=grecacapthaCallback&render=explicit" async defer></script>');
         });
     }
     $app->on('view.styles', function ($event, $styles) use($formmaker) {
         foreach ($this->getFields() as $field) {
             $formmaker->getFieldType($field->type)->addStyles($styles);
         }
     });
 }
開發者ID:Eichi,項目名稱:pagekit-formmaker,代碼行數:18,代碼來源:Form.php

示例2: main

 /**
  * {@inheritdoc}
  */
 public function main(App $app)
 {
     $app->on('boot', function () use($app) {
         $this->framework = $app->module('bixie/pk-framework');
         $app->subscribe(new RouteListener(), new UserListener());
     });
 }
開發者ID:Bixie,項目名稱:pagekit-userprofile,代碼行數:10,代碼來源:UserprofileModule.php

示例3: main

 /**
  * {@inheritdoc}
  */
 public function main(App $app)
 {
     $app->on('boot', function () use($app) {
         $this->framework = $app->module('bixie/pk-framework');
     });
     $app->subscribe(new FormmakerPlugin());
 }
開發者ID:Bixie,項目名稱:pagekit-formmaker,代碼行數:10,代碼來源:FormmakerModule.php

示例4: main

 /**
  * {@inheritdoc}
  */
 public function main(App $app)
 {
     $app['filter']->register('filesize', 'Bixie\\Framework\\Filter\\FileSizeFilter');
     $app->on('boot', function ($event, $app) {
         $app->extend('view', function ($view) use($app) {
             return $view->addHelper(new ImageHelper($app));
         });
     });
 }
開發者ID:Bixie,項目名稱:pagekit-framework,代碼行數:12,代碼來源:FrameworkModule.php

示例5: prepareView

 /**
  * Prepare form for display
  * @param App $app
  * @param \Bixie\Formmaker\FormmakerModule $formmaker
  */
 public function prepareView($app, $formmaker)
 {
     $form = $this;
     if ($this->get('recaptcha') && $formmaker->config('recaptha_secret_key')) {
         $app->on('view.footer', function ($event) {
             $event->addResult('<script src="https://www.google.com/recaptcha/api.js?onload=grecacapthaCallback&render=explicit" async defer></script>');
         });
     }
     $app->on('view.styles', function ($event, $styles) use($formmaker) {
         foreach ($this->getFields() as $field) {
             $formmaker->getFieldType($field->type)->addStyles($styles);
         }
     });
     $app->on('view.data', function ($event, $data) use($form, $formmaker) {
         $data->add('$formmaker', ['config' => $formmaker->publicConfig(), 'formitem' => $form, 'submission' => Submission::initData($form), 'fields' => array_values($form->getFields())]);
         $data->add('$fieldtypes', ['ajax_url' => 'api/formmaker/submission/ajax']);
     });
 }
開發者ID:Bixie,項目名稱:pagekit-formmaker,代碼行數:23,代碼來源:Form.php

示例6: main

 /**
  * {@inheritdoc}
  */
 public function main(App $app)
 {
     if (!in_array('bixie/framework', App::system()->config('extensions'))) {
         throw new \RuntimeException('Bixie Framework required for Formmaker');
     }
     $app->on('boot', function () {
         $this->framework = App::module('bixie/framework');
     });
     $app->subscribe(new FormmakerPlugin());
 }
開發者ID:Eichi,項目名稱:pagekit-formmaker,代碼行數:13,代碼來源:FormmakerModule.php

示例7: main

 /**
  * {@inheritdoc}
  */
 public function main(App $app)
 {
     $app->on('boot', function () {
         $this->framework = App::module('bixie/pk-framework');
     });
 }
開發者ID:Bixie,項目名稱:pagekit-download,代碼行數:9,代碼來源:DownloadModule.php

示例8: clearCache

 /**
  * Clear cache on terminate event.
  */
 public function clearCache(array $options = [])
 {
     App::on('terminate', function () use($options) {
         $this->doClearCache($options);
     }, -512);
 }
開發者ID:apogeecreative,項目名稱:pagekit,代碼行數:9,代碼來源:CacheModule.php


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