本文整理汇总了PHP中sfForm::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP sfForm::__construct方法的具体用法?PHP sfForm::__construct怎么用?PHP sfForm::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfForm
的用法示例。
在下文中一共展示了sfForm::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct(Invoice $invoice)
{
sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'Date'));
$resultUrl = 'https://' . sfContext::getInstance()->getRequest()->getHost() . url_for('payment_privat24_result');
$defaults = array('amt' => $invoice->getAmount(), 'ccy' => 'UAH', 'merchant' => sfConfig::get('app_privat24_merchant'), 'order' => $invoice->getTransactionId(), 'details' => $invoice->getDescription(), 'pay_way' => 'privat24', 'return_url' => $resultUrl, 'server_url' => $resultUrl);
parent::__construct($defaults);
}
示例2: __construct
/**
* Constructor.
*
* @param opAuthAdapter $adapter An opAuthAdapter object
* @param array $defaults An array of field default values
* @param array $options An array of options
* @param string $CRFSSecret A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret)
*
* @see sfForm
*/
public function __construct(opAuthAdapter $adapter, $defaults = array(), $options = array(), $CSRFSecret = null)
{
$this->adapter = $adapter;
parent::__construct($defaults, $options, false);
$this->setWidget('next_uri', new opWidgetFormInputHiddenNextUri());
$this->setValidator('next_uri', new opValidatorNextUri());
}
示例3: __construct
/**
* Constructor.
*
* Notifies the 'form.post_configure' event.
*
* @see sfForm
*/
public function __construct($defaults = array(), $options = array(), $CSRFSecret = null)
{
parent::__construct($defaults, $options, $CSRFSecret);
if (self::$dispatcher) {
self::$dispatcher->notify(new sfEvent($this, 'form.post_configure'));
}
}
示例4: __construct
/**
* Constructor
*/
public function __construct(Invoice $invoice)
{
sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'Date'));
$resultUrl = 'https://' . sfContext::getInstance()->getRequest()->getHost() . url_for('payment_liqpay_result');
$defaults = array('version' => '1.1', 'merchant_id' => sfConfig::get('app_liqpay_merchant'), 'amount' => $invoice->getAmount(), 'currency' => 'UAH', 'order_id' => $invoice->getId(), 'description' => $invoice->getDescription(), 'result_url' => $resultUrl, 'server_url' => $resultUrl);
parent::__construct($defaults);
}
示例5: __construct
public function __construct($defaults = array(), $options = array(), $CSRFSecret = null)
{
if (!$options['fields']) {
throw new sfException('The fields options required!');
}
parent::__construct($defaults, $options, $CSRFSecret);
}
示例6: __construct
/**
* Form constructor.
*
* Available options:
* - embedded_form_class: The class name of the forms to embed. Uses the model name by default.
* (a form based on a collection of Book objects embeds BookForm objects)
* - item_pattern: The pattern used to name each embedded form. Defaults to '%index%'.
* - add_delete: Whether to add a delete widget for each object. Defaults to true.
* - delete_name: Name of the delete widget. Defaults to 'delete'.
* - delete_widget: Optional delete widget object. If left null, uses a sfWidgetFormDelete instance.
* - alert_text: The text of the Javascript alert to show
* - hide_parent: Whether to hide the parent form when clicking the checkbox
* - parent_level: The number of times parentNode must be called to reach the parent to hide.
* Recommended values: 6 for embedded form, 7 for merged form
* - remove_fields: The list of fields to remove from the embedded object forms
*
* @param PropelCollection $collection A collection of Propel objects
* used to initialize default values
* @param array $options An array of options
* @param string $CSRFSecret A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret)
*
* @see sfForm
*/
public function __construct($collection = null, $options = array(), $CSRFSecret = null)
{
$options = array_merge(array(
'item_pattern' => '%index%',
'add_delete' => false,
'delete_name' => 'delete',
'delete_widget' => null,
'remove_fields' => array(),
), $options);
if (!$collection)
{
$this->model = $options['model'];
$collection = new PropelObjectCollection();
$collection->setModel($this->model);
$this->collection = $collection;
}
else
{
if (!$collection instanceof PropelObjectCollection)
{
throw new sfException(sprintf('The "%s" form only accepts a PropelObjectCollection object.', get_class($this)));
}
$this->collection = $collection;
$this->model = $collection->getModel();
}
$this->isEmpty = $this->getCollection()->isEmpty();
parent::__construct(array(), $options, $CSRFSecret);
}
示例7: __construct
public function __construct(array $info, $index)
{
$this->dimensions = $info['amount_of_segments'];
parent::__construct(null, null, false);
$this->setDefault('katuse tüüp', $index);
$this->setDefault('katuse skeema', $info['big_picture_url']);
}
示例8: __construct
/**
* Constructor
*/
public function __construct(Invoice $invoice)
{
sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url'));
$defaults = array('WMI_MERCHANT_ID' => sfConfig::get('app_w1_merchant'), 'WMI_PAYMENT_AMOUNT' => sprintf('%01.2f', $invoice->getAmount()), 'WMI_CURRENCY_ID' => 980, 'WMI_PAYMENT_NO' => $invoice->getId(), 'WMI_DESCRIPTION' => $invoice->geDescription(), 'WMI_SUCCESS_URL' => url_for('payment_w1_success', array(), true), 'WMI_FAIL_URL' => url_for('payment_w1_fail', array(), true), 'WMI_PTENABLED' => 'CashTerminalUAH');
$defaults['WMI_SIGNATURE'] = $this->createSign($defaults);
parent::__construct($defaults);
}
示例9: __construct
public function __construct($id, $value, $soptions)
{
$this->id = $id;
$this->value = $value;
$this->soptions = $soptions;
parent::__construct();
}
示例10: __construct
/**
* Constructor
*/
public function __construct(Invoice $invoice, array $wallets)
{
$this->invoice = $invoice;
$this->wallets = $wallets;
$defaults = array('LMI_SIM_MODE' => sfConfig::get('app_webmoney_sim_mode'), 'LMI_PAYMENT_NO' => $invoice->getId(), 'LMI_PAYMENT_DESC_BASE64' => base64_encode($invoice->getDescription()));
parent::__construct($defaults);
}
示例11: __construct
/**
* Constructor.
*
* @param sfUser A sfUser instance
* @param array An array of options
* @param string A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret)
*
* @see sfForm
*/
public function __construct(sfUser $user, $options = array(), $CSRFSecret = null)
{
$this->user = $user;
parent::__construct(array(), $options, $CSRFSecret);
// the defaults depend on the options, so set them after construction
$this->setDefaults(array('max_per_page' => $user->getAttribute(self::getMaxPerPageName(), self::getMaxPerPageValue())));
}
示例12: __construct
public function __construct($page = null)
{
if (!$page) {
$page = new aPage();
}
$this->page = $page;
parent::__construct();
}
示例13: __construct
public function __construct($section = false)
{
if ($section === false) {
$section = $_SERVER['REQUEST_URI'];
}
$this->section = $section;
parent::__construct();
}
示例14: __construct
public function __construct($profileMember = array(), $options = array(), $CSRFSecret = null)
{
parent::__construct(array(), $options, $CSRFSecret);
$profiles = Doctrine::getTable('Profile')->findAll();
foreach ($profileMember as $profile) {
$this->setDefault($profile->getName(), array('value' => $profile->getValue(), 'public_flag' => $profile->getPublicFlag()));
}
}
示例15: __construct
public function __construct($active = null)
{
if (is_null($active)) {
$active = array('1');
}
$this->active = array_flip($active);
parent::__construct();
}