当前位置: 首页>>代码示例>>PHP>>正文


PHP sfWidgetFormSchema类代码示例

本文整理汇总了PHP中sfWidgetFormSchema的典型用法代码示例。如果您正苦于以下问题:PHP sfWidgetFormSchema类的具体用法?PHP sfWidgetFormSchema怎么用?PHP sfWidgetFormSchema使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了sfWidgetFormSchema类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setup

 /**
  * Setup the form.  To overload, you should use ->configure()
  */
 public function setup()
 {
     $widgetSchema = new sfWidgetFormSchema(array('query' => new sfWidgetFormInput()), array(), array(), array(), array());
     $widgetSchema->addFormFormatter('sfLuceneSimple', new sfLuceneWidgetFormatterSimple($widgetSchema));
     $widgetSchema->setFormFormatterName('sfLuceneSimple');
     $widgetSchema->setNameFormat('form[%s]');
     $validatorSchema = new sfValidatorSchema(array('query' => new sfValidatorString(array('required' => true)), 'page' => new sfValidatorInteger(array('required' => false, 'empty_value' => 1))), array(), array());
     if ($this->hasCategories()) {
         $widgetSchema['category'] = new sfWidgetFormSelect(array('choices' => $this->getCategories(), 'multiple' => false));
         $validatorSchema['category'] = new sfValidatorChoice(array('required' => false, 'choices' => $this->getCategories()));
     }
     $this->setWidgetSchema($widgetSchema);
     $this->setValidatorSchema($validatorSchema);
 }
开发者ID:rande,项目名称:sfSolrPlugin,代码行数:17,代码来源:sfLuceneSimpleFormBase.class.php

示例2: setup

 public function setup()
 {
     $this->enablePlugins('sfPropelORMPlugin');
     $this->enablePlugins('sfGuardPlugin');
     $this->enablePlugins('sfLESSPlugin');
     sfWidgetFormSchema::setDefaultFormFormatterName('div');
 }
开发者ID:xfifix,项目名称:Jenkins-Khan,代码行数:7,代码来源:ProjectConfiguration.class.php

示例3: configure

  public function configure()
  {

    // SET DEFAULT FORM-FORMATTER
    sfWidgetFormSchema::setDefaultFormFormatterName('bootstrap');
    
  }
开发者ID:romankallweit,项目名称:swingmachine,代码行数:7,代码来源:backendConfiguration.class.php

示例4: execute

 public function execute($filterChain)
 {
     $context = $this->getContext();
     $request = $context->getRequest();
     if (jfPortableDevice::isPortableDevice()) {
         $layout = isset(self::$_layout) ? self::$_layout : $this->getParameter('layout');
         $context->getActionStack()->getFirstEntry()->getActionInstance()->setLayout($layout);
         if (class_exists('sfWidgetFormSchema')) {
             // compatibility with symfony 1.0
             sfWidgetFormSchema::setDefaultFormFormatterName($this->getParameter('defaultFormFormatterName', 'jfPD'));
         }
         jfPortableDevice::setPageAttribute('data-url', $request->getUri());
     }
     $filterChain->execute();
     if (jfPortableDevice::isPortableDevice()) {
         if (jfPortableDevice::getConfig('lazyLoadImages')) {
             $response = $context->getResponse();
             $content = $response->getContent();
             $content = preg_replace('/(<img.*)(src=)([\'|\\"].*>)/', '$1data-jfPD-src=$3', $content);
             $response->setContent($content);
         }
         if (jfPortableDevice::isNativeApp()) {
             sfConfig::set('sf_web_debug', false);
         }
     }
 }
开发者ID:muliadi,项目名称:jfportabledevice,代码行数:26,代码来源:jfPortableDeviceFilter.class.php

示例5: setup

 public function setup()
 {
     $this->enablePlugins('sfDoctrinePlugin');
     $this->enablePlugins('sfThumbnailPlugin');
     $this->enablePlugins('sfImageTransformPlugin');
     $this->enablePlugins('sfFormExtraPlugin');
     sfWidgetFormSchema::setDefaultFormFormatterName('list');
 }
开发者ID:thefkboss,项目名称:ZenTracker,代码行数:8,代码来源:ProjectConfiguration.class.php

示例6: configure

 public function configure()
 {
     // Cookie settings for increased security
     ini_set('session.use_only_cookies', "1");
     ini_set('session.cookie_httponly', "1");
     ProjectConfiguration::getActive()->loadHelpers(array('I18N', 'OrangeDate', 'Orange', 'Url'));
     sfWidgetFormSchema::setDefaultFormFormatterName('Default');
 }
开发者ID:EFForg,项目名称:lemonhrm,代码行数:8,代码来源:orangehrmConfiguration.class.php

示例7: setup

 public function setup()
 {
     sfWidgetFormSchema::setDefaultFormFormatterName('list');
     $this->culture = $this->getOption('culture', sfConfig::get('sf_default_culture'));
     $this->JQueryDateOptions['culture'] = substr($this->culture, 0, 2);
     $this->JQueryDateOptions['image'] = $this->getImagePath('icons/calendar.png');
     $startYear = sfConfig::get('app_year_range_start', date('Y') - 5);
     $years = range($startYear, date('Y') + 5);
     $this->JQueryDateOptions['years'] = array_combine($years, $years);
 }
开发者ID:solutema,项目名称:siwapp-sf1,代码行数:10,代码来源:BaseFormDoctrine.class.php

示例8: initialize

 public function initialize()
 {
     parent::initialize();
     if (!opMobileUserAgent::getInstance()->isCookie()) {
         ini_set('session.use_only_cookies', 0);
         ini_set('session.use_cookies', 0);
         ini_set('session.use_trans_sid', 1);
     }
     sfWidgetFormSchema::setDefaultFormFormatterName('mobile');
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:10,代码来源:mobile_frontendConfiguration.class.php

示例9: configure

  public function configure()
  {

    // SET DEFAULT FORM-FORMATTER
    /* sfWidgetFormSchema::setDefaultFormFormatterName('bootstrap'); */    
    sfWidgetFormSchema::setDefaultFormFormatterName('foundation');

    ProjectConfiguration::getActive()->loadHelpers( array('I18N') ); 

  }
开发者ID:romankallweit,项目名称:swingmachine,代码行数:10,代码来源:frontendConfiguration.class.php

示例10: setup

 public function setup()
 {
     $this->enablePlugins('sfDoctrinePlugin');
     $this->enablePlugins('sfDoctrineGuardPlugin');
     $this->enablePlugins('ioMenuPlugin');
     $this->enablePlugins('sfFormExtraPlugin');
     $this->enablePlugins('sfDoctrineApplyPlugin');
     $this->enablePlugins('sfTCPDFPlugin');
     $this->enablePlugins('sfTaskExtraPlugin');
     $this->enablePlugins('sfZurbFoundationPlugin');
     //// changing webDir if on donax
     if (@$_SERVER['HTTP_HOST'] == 'otokou.donax.ch') {
         $this->setWebDir($this->getRootDir() . '/..');
     }
     $this->enablePlugins('sfJqueryReloadedPlugin');
     // defines the default schema formatter for forms
     sfWidgetFormSchema::setDefaultFormFormatterName('otokou');
 }
开发者ID:rbolliger,项目名称:otokou,代码行数:18,代码来源:ProjectConfiguration.class.php

示例11: setup

 /**
  * Setup the form.  To overload, you should use ->configure()
  */
 public function setup()
 {
     $widgetSchema = new sfWidgetFormSchema(array('keywords' => new sfWidgetFormInput(), 'musthave' => new sfWidgetFormInput(), 'mustnothave' => new sfWidgetFormInput(), 'hasphrase' => new sfWidgetFormInput()), array(), array(), array('keywords' => 'May contain keywords', 'musthave' => 'Must contain keywords', 'mustnothave' => 'Must exclude keywords', 'hasphrase' => 'Contains exact phrase'), array());
     $widgetSchema->addFormFormatter('sfLuceneAdvanced', new sfLuceneWidgetFormatterAdvanced($widgetSchema));
     $widgetSchema->setFormFormatterName('sfLuceneAdvanced');
     $widgetSchema->setNameFormat('form[%s]');
     $validatorSchema = new sfValidatorSchema(array('keywords' => new sfValidatorString(array('required' => false)), 'musthave' => new sfValidatorString(array('required' => false)), 'mustnothave' => new sfValidatorString(array('required' => false)), 'hasphrase' => new sfValidatorString(array('required' => false))), array(), array());
     if ($this->hasCategories()) {
         $widgetSchema['category'] = new sfWidgetFormSelect(array('choices' => $this->getCategories(), 'multiple' => false));
         $widgetSchema->setLabel('category', 'Must be in category');
         $validatorSchema['category'] = new sfValidatorChoice(array('required' => false, 'choices' => $this->getCategories()));
     }
     $this->setWidgetSchema($widgetSchema);
     $this->setValidatorSchema($validatorSchema);
 }
开发者ID:palcoprincipal,项目名称:sfLucenePlugin,代码行数:18,代码来源:sfLuceneAdvancedFormBase.class.php

示例12: __construct

 /**
  * Constructor.
  *
  * @param sfWidgetFormSchema $widget      An sfWidgetFormSchema instance
  * @param integer            $count       The number of times to duplicate the widget
  * @param array              $options     An array of options
  * @param array              $attributes  An array of default HTML attributes
  * @param array              $labels      An array of HTML labels
  *
  * @see sfWidgetFormSchema
  */
 public function __construct(sfWidgetFormSchema $widget, $count, $options = array(), $attributes = array(), $labels = array())
 {
     parent::__construct(array_fill(0, $count, $widget), $options, $attributes, $labels);
 }
开发者ID:xfifix,项目名称:symfony-1.4,代码行数:15,代码来源:sfWidgetFormSchemaForEach.class.php

示例13: __construct

 /**
  * Constructor.
  *
  * @param sfWidgetFormSchema $widget     A sfWidgetFormSchema instance
  * @param string             $decorator  A decorator string
  *
  * @see sfWidgetFormSchema
  */
 public function __construct(sfWidgetFormSchema $widget, $decorator)
 {
     $this->widget = $widget;
     $this->decorator = $decorator;
     parent::__construct();
 }
开发者ID:WIZARDISHUNGRY,项目名称:symfony,代码行数:14,代码来源:sfWidgetFormSchemaDecorator.class.php

示例14: configure

 public function configure()
 {
     ProjectConfiguration::getActive()->loadHelpers(array('I18N', 'OrangeDate', 'Orange', 'Url'));
     sfWidgetFormSchema::setDefaultFormFormatterName('Default');
 }
开发者ID:CamilleCrespeau,项目名称:orangehrm,代码行数:5,代码来源:orangehrmConfiguration.class.php

示例15: dirname

<?php

/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
require_once dirname(__FILE__) . '/../../bootstrap/unit.php';
$t = new lime_test(31);
// widgets
$authorSchema = new sfWidgetFormSchema(array('id' => new sfWidgetFormInputHidden(), 'name' => $nameWidget = new sfWidgetFormInputText()));
$authorSchema->setNameFormat('article[author][%s]');
$schema = new sfWidgetFormSchema(array('title' => $titleWidget = new sfWidgetFormInputText(), 'author' => $authorSchema));
$schema->setNameFormat('article[%s]');
// errors
$authorErrorSchema = new sfValidatorErrorSchema(new sfValidatorString());
$authorErrorSchema->addError(new sfValidatorError(new sfValidatorString(), 'name error'), 'name');
$articleErrorSchema = new sfValidatorErrorSchema(new sfValidatorString());
$articleErrorSchema->addError($titleError = new sfValidatorError(new sfValidatorString(), 'title error'), 'title');
$articleErrorSchema->addError($authorErrorSchema, 'author');
$parent = new sfFormFieldSchema($schema, null, 'article', array('title' => 'symfony', 'author' => array('name' => 'Fabien')), $articleErrorSchema);
$f = $parent['title'];
$child = $parent['author'];
// ->getValue() ->getWidget() ->getParent() ->getError() ->hasError()
$t->diag('->getValue() ->getName() ->getWidget() ->getParent() ->getError() ->hasError()');
$t->ok($f->getWidget() == $titleWidget, '->getWidget() returns the form field widget');
$t->is($f->getName(), 'title', '->getName() returns the form field name');
$t->is($f->getValue(), 'symfony', '->getValue() returns the form field value');
$t->is($f->getParent(), $parent, '->getParent() returns the form field parent');
开发者ID:bigcalm,项目名称:urlcatcher,代码行数:31,代码来源:sfFormFieldTest.php


注:本文中的sfWidgetFormSchema类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。