本文整理汇总了PHP中sfWebRequest::getPostParameters方法的典型用法代码示例。如果您正苦于以下问题:PHP sfWebRequest::getPostParameters方法的具体用法?PHP sfWebRequest::getPostParameters怎么用?PHP sfWebRequest::getPostParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfWebRequest
的用法示例。
在下文中一共展示了sfWebRequest::getPostParameters方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeResult
/**
* Result URL
*/
public function executeResult(sfWebRequest $request)
{
$invoiceId = (int) $request->getParameter('LMI_PAYMENT_NO');
$invoice = Doctrine::getTable('Invoice')->findOneById($invoiceId);
if (!$invoice) {
return $this->renderText('INVOICE NOT FOUND');
return sfView::NONE;
}
$wallets = $this->getWallets($invoice);
// Предварительный запрос
if ($request->getParameter('LMI_PREREQUEST')) {
$form = new WebmoneyPreResultForm($invoice, $wallets);
$form->bind($params = $request->getPostParameters());
if ($form->isValid()) {
return $this->renderText('YES');
} else {
return $this->renderText('INVALID');
}
return sfView::NONE;
}
// Оповещение о платеже
$form = new WebmoneyResultForm($invoice, $wallets);
$form->bind($params = $request->getPostParameters());
if ($form->isValid()) {
$this->complete($invoice, $params);
return $this->renderText('YES');
}
return sfView::NONE;
}
示例2: executeUpdateText
/**
* Update existing text
* @param sfWebRequest $request
* @return <type>
*/
public function executeUpdateText(sfWebRequest $request) {
$data = $request->getPostParameters();
$data['content'] = $data['contenttype'] == 'plain' ? $data['content_textarea'] : $data['content_htmleditor'];
$result = AdditionalTextTable::instance()->updateText($data,$request->getParameter('id'));
$this->renderText('{success:true}');
return sfView::NONE;
}
示例3: executeSave
/**
* Saves new or update role. Echoes error/success message
*/
public function executeSave(sfWebRequest $request)
{
if (!$this->getUser()->hasCredential(array('Administrator'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
$id = $request->getParameter('id');
if ($id) {
$role = RolePeer::retrieveByPK($id);
if (!$role instanceof Role) {
return $this->renderText('<span style="color:red;">Role not found or is removed!</span>');
}
$form = new RoleForm($role);
} else {
$form = new RoleForm();
}
unset($form['_csrf_token']);
$form->bind($request->getPostParameters());
if ($form->isValid()) {
$form->save();
return $this->renderText('Role has been successfully saved!');
} else {
# FIXME display other field errors
echo 'e1';
# has error
echo '<span style="color:red;">' . $form['title']->getError()->getMessage() . '</span>';
}
return sfView::NONE;
}
示例4: executeListBooking
public function executeListBooking(sfWebRequest $request)
{
$this->form = new BookingForm();
if ($request->isMethod('post')) {
$this->form->bind($request->getPostParameters());
if ($this->form->isValid()) {
$values = $this->form->getValues();
$emails = $values['input'];
$tournament = TournamentTable::getInstance()->findOneById($values['tournament']);
$num = 0;
foreach ($emails as $email => $nick) {
$count = PlayerTable::getInstance()->findOneByEmail($email);
if ($count) {
$num++;
$this->getUser()->setFlash('error', $num . " joueurs déja inscrit(s).", false);
} else {
$player = $this->createBookedPlayer($email, $nick, $tournament);
$this->sendConfirmationMail($player);
}
}
$this->getUser()->setFlash('notice', count($emails) - $num . " joueurs inscrits.", false);
} else {
$this->getUser()->setFlash('error', "Erreurs dans le formulaire.", false);
}
}
}
示例5: executeSaveData
/**
* Create the config file with the database settings and write email settings
*
* @param sfWebRequest $request
* @return <type>
*/
public function executeSaveData(sfWebRequest $request) {
$sysObj = new SystemSetting();
$installer = new Installer();
$data = $request->getPostParameters();
$installer->createConfigFile($data); // write settings in database.yml
// create DB
$task = new sfDoctrineBuildAllReLoadTask(sfContext::getInstance()->getEventDispatcher(), new sfFormatter());
chdir(sfConfig::get('sf_root_dir'));
$task->run(array(),array('--no-confirmation', '--env=all', '--dir='.sfConfig::get('sf_root_dir').'/data/fixtures/'.$data['productive_data'].''));
$data = $sysObj->buildEmailSetting($data);
UserLoginTable::instance()->updateEmail($data['productive_emailadresse']);
EmailConfigurationTable::instance()->updateEmailConfiguration($data);
// clear cache
$taskCC = new sfCacheClearTask(sfContext::getInstance()->getEventDispatcher(), new sfFormatter());
$taskCC->run(array(), array());
// create JS Cache
$ccCache = new TemplateCaching();
$ccCache->checkCacheDir();
$ccCache->setFiles();
$lastModified = $ccCache->getLastModifiedFile();
$cacheCreated = $ccCache->getCurrentCacheStamp();
if($lastModified > $cacheCreated OR $cacheCreated == '') {
if($cacheCreated == '') {
$cacheCreated = $lastModified;
}
$ccCache->createCache($lastModified, $cacheCreated);
}
// return success, then JS redirect
$this->renderText('{success:true}');
return sfView::NONE;
}
示例6: executeSave
/**
* Saving project
*
* @param sfWebRequest $request
* @author Sergey Startsev
*/
public function executeSave(sfWebRequest $request)
{
$params = $request->getPostParameters();
unset($params['latest']);
unset($params['path']);
$parameters = array('params' => $request->getParameter('params'));
$response = afStudioCommand::process('project', 'save', $parameters);
return $this->renderJson($response);
}
示例7: executeIpn
/**
* Action called by the Paypal server to confirm the client's transaction.
*
* @param sfWebRequest $request
* @return void
*/
public function executeIpn(sfWebRequest $request)
{
//--------------------------------------------------------------------------
// instanciate application specific Paypal Interface
//--------------------------------------------------------------------------
$pp_class = sfConfig::get('app_es_paypal_plugin_handler', 'esPaypalHandler');
$pp = new $pp_class();
//--------------------------------------------------------------------------
// handle data posted by Paypal (store as transaction)
//--------------------------------------------------------------------------
$pp->handleIpn($request->getPostParameters());
return sfView::NONE;
}
示例8: executeUpdateDocumenttemplate
/**
* Update a documenttemplate, and create a new version
* @param sfWebRequest $request
* @return <type>
*/
public function executeUpdateDocumenttemplate(sfWebRequest $request) {
$docObj = new Documenttemplate();
$data = $request->getPostParameters();
DocumenttemplateVersionTable::instance()->setTemplateInactiveById($request->getParameter('id')); // set old template inactive
$template_array = DocumenttemplateVersionTable::instance()->getDocumentTemplateId($request->getParameter('id'))->toArray(); // get old template
$template_id = $template_array[0]['documenttemplate_id'];
$version = $template_array[0]['version']+1;// create the nexte version of the template
$version_id = $docObj->storeVersion($template_id, $version); // write new version
$slots = $data['slot'];
$docObj->storeData($slots, $version_id); // store slots
$this->renderText('{success:true}');
return sfView::NONE;
}
示例9: executeRating
public function executeRating(sfWebRequest $request)
{
if ($request->isXmlHttpRequest()) {
$postParam = $request->getRequestParameters();
$postParam2 = $request->getPostParameters();
if ((array_key_exists('rating', $postParam) || array_key_exists('rating', $postParam2)) && array_key_exists('querytrackid', $postParam) && array_key_exists('resulttrackid', $postParam) && array_key_exists('resultposition', $postParam) && array_key_exists('featurevectortypeid', $postParam) && array_key_exists('distancetypeid', $postParam)) {
$rating = array_key_exists('rating', $postParam) ? $postParam['rating'] : $postParam2['rating'];
QueryCommentTrackPeer::updateRating($rating, $postParam['querytrackid'], $postParam['resulttrackid'], $postParam['resultposition'], $postParam['featurevectortypeid'], $postParam['distancetypeid']);
return $this->renderText($postParam['rating']);
}
}
$this->getResponse()->setStatusCode(500);
return $this->renderText("Comment was not saved! Please contact us about the problem." . print_r($postParam, true) . print_r($postParam2, true));
}
示例10: executeResult
public function executeResult(sfWebRequest $request)
{
$transactionId = (int) $request->getParameter('OrderID');
$invoice = Doctrine::getTable('Invoice')->findOneByTransactionId($transactionId);
$this->forward404Unless($invoice, 'Invoice not found.');
// Оповещение о платеже
$form = new SentryResultForm($invoice);
$form->bind($params = $request->getPostParameters());
if ($form->isValid()) {
$this->complete($invoice, $params);
}
$this->responseCode = @$params['ResponseCode'];
$this->reasonCode = @$params['ReasonCode'];
$this->reasonCodeDesc = @$params['ReasonCodeDesc'];
}
示例11: extractParameters
/**
*
* @param sfWebRequest $request
* @return WSRequestParameters
*/
public function extractParameters(sfWebRequest $request)
{
$webRequestParameters = new WSRequestParameters();
$logger = Logger::getLogger('core.webservices');
$requestMethod = $request->getMethod();
$contentType = $request->getContentType();
$logger->debug("HTTP Method: {$requestMethod}, Content-Type: {$contentType}");
$requestParameters = $request->getRequestParameters();
$logger->debug("Request Parameters: " . print_r($requestParameters, true));
if (!isset($requestParameters['ws_method'])) {
throw new WebServiceException('Web service method is not specified', 400);
}
$webServiceMethod = $requestParameters['ws_method'];
$methodParameters = array();
// Checking for deprecated method of sending parameters using an http header
$header = $request->getHttpHeader('ohrm_ws_method_parameters');
if (!empty($header)) {
$methodParameters = json_decode($header, true);
if (!is_array($methodParameters)) {
throw new WebServiceException("header ohrm_ws_method_parameters should be json encoded", 400);
}
} else {
// get request parameters in URL (eg: /empNumber/11) after removing the default parameters
$methodParameters = array_diff_key($requestParameters, array_flip(array('action', 'module', 'ws_method', '_sf_route')));
// Merge with GET parameters
$methodParameters = array_merge($methodParameters, $request->getGetParameters());
// Check for JSON encoded body
if ($contentType === 'application/json') {
$postParams = json_decode(file_get_contents('php://input'), true);
$methodParameters = array_merge($methodParameters, $postParams);
} else {
if ($requestMethod === 'POST') {
$methodParameters = array_merge($methodParameters, $request->getPostParameters());
}
}
}
// $arrayName = $this->getArrayNameForFunction($function);
// if(!array_key_exists($arrayName, $methodParameters)) {
// throw new WebServiceException('Required array name not provided', 404);
// }
$webRequestParameters->setRequestMethod($requestMethod);
$webRequestParameters->setMethod($webServiceMethod);
$webRequestParameters->setParameters($methodParameters);
// $webRequestParameters->setAppId($authenticationParamerters['app_id']);
// $webRequestParameters->setAppToken($authenticationParamerters['app_token']);
// $webRequestParameters->setSessionToken($authenticationParamerters['session_token']);
return $webRequestParameters;
}
示例12: executeShowLecture
/**
* Executes showLecture action
*
* @param sfRequest $request A request object
*/
public function executeShowLecture(sfWebRequest $request)
{
$this->lecture = $this->getRoute()->getObject();
$this->course = $this->lecture->Course;
$this->forms['homework'] = new HomeworkForm();
$this->forms['aid'] = new AidForm();
if ($request->isMethod('POST')) {
$types = array_keys($request->getPostParameters());
$this->executeUploadFile($request, $types[0]);
}
$this->setVar('lecture', $this->lecture);
$this->setVar('course', $this->course);
$this->setVar('form', $this->forms['homework']);
$this->setVar('aidForm', $this->forms['aid']);
$this->setVar('user', $this->user);
}
示例13: executeResult
/**
* Result URL
*/
public function executeResult(sfWebRequest $request)
{
$invoiceId = (int) $request->getParameter('WMI_PAYMENT_NO');
$invoice = Doctrine::getTable('Invoice')->findOneById($invoiceId);
if (!$invoice) {
return $this->renderText('WMI_RESULT=RETRY&WMI_DESCRIPTION=INVOICE NOT FOUND');
return sfView::NONE;
}
$form = new W1ResultForm($invoice);
$form->bind($params = $request->getPostParameters());
if ($form->isValid()) {
$this->complete($invoice, $params);
return $this->renderText('WMI_RESULT=OK');
}
return $this->renderText('WMI_RESULT=RETRY&WMI_DESCRIPTION=INVALID FORM');
}
示例14: executeUpdateEquivalence
public function executeUpdateEquivalence(sfWebRequest $request)
{
$parametrs = $request->getPostParameters();
$this->career_school_year = CareerSchoolYearPeer::retrieveByPK($parametrs['career_school_year_id']);
$this->career = $this->career_school_year->getCareer();
$this->career_subject_school_years = array();
$this->years = array();
$this->forms = array();
for ($y = 1; $y <= $this->career->getQuantityYears(); $y++) {
$this->years[] = $y;
$this->career_subject_school_years[$y] = $this->career->getCareerSubjectsForYear($y, true);
}
unset($parametrs['_save']);
unset($parametrs['career_school_year_id']);
$valid = true;
foreach ($parametrs as $parameter) {
$career_subject_id = $parameter['career_subject_id'];
$student_id = $parameter['student_id'];
$school_year_id = $parameter['school_year'];
$career_subject = CareerSubjectPeer::retrieveByPK($career_subject_id);
$student = StudentPeer::retrieveByPK($student_id);
$student_approved_career_subject = StudentApprovedCareerSubjectPeer::retrieveOrCreateByCareerSubjectAndStudent($career_subject->getId(), $student->getId());
$student_approved_career_subject->setSchoolYearId($school_year_id);
$parameter['career_subject_id'] = $student_approved_career_subject->getCareerSubjectId();
$this->form = new EquivalenceForm($student_approved_career_subject);
$this->form->setCareerSubjectAndStudent($career_subject, $student);
if (isset($parameter['mark']) && $parameter['mark'] != "") {
$this->form->bind($parameter);
if ($this->form->isValid()) {
$this->form->save();
} else {
$valid = false;
}
}
$this->form = new EquivalenceForm($student_approved_career_subject);
$this->form->setCareerSubjectAndStudent($career_subject, $student);
$this->forms[$career_subject->getId()] = $this->form;
$parameter['career_subject_id'] = $career_subject_id;
}
if ($valid) {
$this->getUser()->setFlash('notice', 'subjects are updated correctly');
} else {
$this->setProcessFormErrorFlash();
}
$this->module = $this->getModuleName();
$this->setTemplate('makeUpEquivalence');
}
示例15: executeResult
public function executeResult(sfWebRequest $request)
{
$invoiceId = (int) $request->getParameter('order_id');
$invoice = Doctrine::getTable('Invoice')->findOneById(intval($orderId));
$this->forward404Unless($invoice, 'Invoice not found.');
// Оповещение о платеже
$form = new LiqpayResultForm($invoice);
$form->bind($params = $request->getPostParameters());
if ($form->isValid()) {
$this->status = $request->getParameter('status');
if ($this->status == 'success') {
$this->complete($invoice, $params);
}
} else {
$this->status = 'failure';
}
}