本文整理汇总了PHP中dpm函数的典型用法代码示例。如果您正苦于以下问题:PHP dpm函数的具体用法?PHP dpm怎么用?PHP dpm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dpm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
ob_start();
print eval($form_state['values']['code']);
$_SESSION['devel_execute_code'] = $form_state['values']['code'];
dpm(ob_get_clean());
}
示例2: submitForm
public function submitForm(array &$form, FormStateInterface $form_state)
{
dpm($form_state, '$form_state @ submitForm');
//drupal_set_message(t('Your message is @message', array('@message' => $form_state->getValues()['message'])));
// $this->setConfigurationValue('fax_block_settings', $form_state->getValue('fax_block_settings'));
$form_state->setRedirect('hello.hello_page');
}
示例3: save
function save(NewsMaterial $newsMaterial)
{
dpm($newsMaterial);
foreach ($newsMaterial->content as $news_item) {
}
// TODO: Implement save() method.
}
示例4: save
function save(FileMaterial $fileMaterial)
{
$wo = wechat_api_init_wechatobj();
$file_content = $wo->getForeverMedia($fileMaterial->media_id);
$file = file_save_data($file_content, 'public://' . $fileMaterial->name);
dpm($file);
}
示例5: updateProduct
function updateProduct($data)
{
$url = "https://api.weixin.qq.com/scan/product/update?access_token={$this->access_token()}";
$data = json_encode($data, JSON_UNESCAPED_UNICODE);
dpm($data);
return $this->request($url, 'POST', $data);
}
示例6: getTaxonomyTermsAsSelectOptions
/**
* @param \stdClass $config
* @return array
*/
protected function getTaxonomyTermsAsSelectOptions($config)
{
$answer = [];
if (isset($config->vocabulary) && isset($config->level)) {
/** @var \stdClass $vocabulary */
if ($vocabulary = taxonomy_vocabulary_machine_name_load($config->vocabulary)) {
$tree = $tree = taxonomy_get_tree($vocabulary->vid, 0, null, true);
dpm($tree, "FLAT TREE");
/*
if(count($terms) == 1) {
$term = array_pop($terms);
if(isset($term->description)) {
$answer = $term->description;
if($stripHtml) {
$answer = strip_tags($answer);
}
}
}*/
} else {
drupal_set_message("Vocabulary not found by name: " . $config->vocabulary, 'warning');
}
} else {
drupal_set_message("Vocabulary or Level not set in config: " . json_encode($config), 'warning');
}
return $answer;
}
示例7: dbErrorMsg
function dbErrorMsg($msg)
{
if (function_exists("dpm")) {
dpm($msg, "DB Error");
} else {
print "ChapR ERP: \"{$msg}\"\n";
}
}
示例8: submitForm
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state)
{
ob_start();
$code = $form_state->getValue('code');
print eval($code);
$_SESSION['devel_execute_code'] = $code;
dpm(ob_get_clean());
}
示例9: bootstrap_short_answer_user_answer
function bootstrap_short_answer_user_answer($variables)
{
dpm($variables);
dpm($node);
$answer = $variables['answer'];
$correct = $variables['correct'];
$header = array(t('Correct Answer'), t('User Answer'));
$row = array(array($correct, $answer));
return theme('table', array('header' => $header, 'rows' => $row));
}
示例10: dpm_once
/**
* Quick function to dpm only one call from a loop etc.
*/
function dpm_once($input, $name = NULL, $type = 'status')
{
$backtrace = debug_backtrace();
$caller = array_shift($backtrace);
$executed =& drupal_static(__FUNCTION__ . $caller['file'] . $caller['line'], FALSE);
if (!$executed) {
$executed = TRUE;
if (function_exists('dpm')) {
dpm($input, $name, $type);
}
}
}
示例11: watersportkampen_bootstrap_form_culturefeed_entry_ui_event_form_alter
function watersportkampen_bootstrap_form_culturefeed_entry_ui_event_form_alter(&$form, &$form_state, $event = NULL)
{
$sports = _watersportkampen_bootstrap_get_sports();
if (isset($form['#event'])) {
$keywords = $form['#event']->getKeywords();
$sports_default_value = array_intersect(array_map('strtolower', $keywords), array_map('strtolower', $sports));
$sports_default_value = array_map('ucfirst', $sports_default_value);
foreach ($sports_default_value as $sport_default_value) {
try {
$form['#event']->deleteKeyword(strtolower($sport_default_value));
} catch (Exception $e) {
}
try {
$form['#event']->deleteKeyword(ucfirst($sport_default_value));
} catch (Exception $e) {
}
}
}
$form['basic']['title']['#weight'] = 1;
$form['basic']['sports'] = array('#type' => 'checkboxes', '#title' => 'Sporten', '#options' => $sports, '#description' => 'Kies hier de sporten die voorkomen in uw sportkamp', '#weight' => 1, '#default_value' => isset($sports_default_value) ? $sports_default_value : array());
$form['basic']['location']['#weight'] = 2;
$form['basic']['when']['#weight'] = 3;
unset($form['basic']['what']);
unset($form['extra']['tags']);
unset($form['extra']['old_tags']);
if (isset($form['#event'])) {
watersportkampen_bootstrap_form_culturefeed_entry_ui_tags_form_alter($form, $form_state, $form['#event']);
} else {
watersportkampen_bootstrap_form_culturefeed_entry_ui_tags_form_alter($form, $form_state);
}
$form['extra']['description']['#weight'] = 6;
$form['extra']['tags']['#weight'] = 7;
$form['extra']['old_tags']['#weight'] = 8;
$form['extra']['links']['#weight'] = 9;
$form['extra']['add_more_links']['#weight'] = 10;
$form['extra']['add_more_links']['#limit_validation_errors'] = array();
$form['extra']['photo']['#weight'] = 11;
$form['extra']['price']['#weight'] = 12;
$form['extra']['organiser']['#weight'] = 13;
$form['extra']['age_category']['#weight'] = 14;
$form['extra']['age']['#weight'] = 15;
$form['extra']['fly']['#weight'] = 16;
$form['extra']['vertical_tabs']['#weight'] = 17;
dpm($form);
unset($form['extra']['performers']);
unset($form['extra']['language']);
unset($form['extra']['entrance']);
unset($form['extra']['translations']);
unset($form['extra']['publication_date']);
unset($form['submit']);
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'), '#validate' => array('watersportkampen_bootstrap_event_save_validate'));
}
示例12: debug_url
function debug_url($return = FALSE)
{
if ($return) {
return $this->build_url();
}
if (function_exists('dpm') && function_exists('krumo')) {
dpm($this->build_url());
} elseif (function_exists('krumo')) {
krumo($this->build_url());
} else {
print '<pre>' . $this->build_url() . '</pre>';
}
}
示例13: mail
/**
* Overrides DefaultMailSystem::mail().
*
* Accepts an e-mail message and displays it on screen, and additionally logs
* it to watchdog().
*/
public function mail(array $message)
{
$header = "To: {$message['to']} <br />Subject: {$message['subject']}";
$string = check_plain(print_r($message, TRUE));
$string = '<pre>' . $string . '</pre>';
if (module_exists('devel')) {
dpm($message, $header);
} else {
drupal_set_message($header . ' ' . $string);
}
// Don't actually use debug to display the message since we want to be able
// to categorize the watchdog type as 'mail' so it can be filterable in
// UI.
watchdog('mail', $header . ' ' . $string, NULL, WATCHDOG_INFO);
return TRUE;
}
示例14: _updateFields
/**
* Update field
*/
function _updateFields($nid = NULL)
{
$node = node_load($nid);
if (isset($node->field_product_description['zh-hans'][0]['value'])) {
dpm($node->nid . ' have CN');
} else {
if (isset($node->field_product_description['en'][0]['value'])) {
$node->field_product_description['zh-hans'][0]['value'] = $node->field_product_description['en'][0]['value'];
// It's good to call field_attach_presave()
field_attach_presave('node', $node);
field_attach_update('node', $node);
dpm($node->nid . ' Update CN');
} else {
dpm($node->nid . ' No English');
}
}
}
示例15: build
/**
* Implements \Drupal\Core\Block\BlockBase::blockBuild().
*/
public function build()
{
// case 'News':
// $blocks['subject'] = t('Photo\'s on News');
// $blocks['content'] = array(
// '#markup' => '<div id="News_images"> </div>',
// '#attached' => array(
// 'js' => array(
// 'data' => drupal_get_path('module', 'dd_tools') . '/js/News.js',
// array(
// 'data' => array(
// 'dd_tools' => array(
// 'block_items' => variable_get('News_items', 13),
// ),
// ),
// 'type' => 'setting',
// ),
// ),
// ),
// );
$query = db_select('node', 'n')->fields('n')->addTag('node_access')->range(0, $this->configuration['block_count']);
$result = $query->execute();
dpm($result);
foreach ($result as $row) {
dsm($row);
var_dump($row);
}
$elements = array();
if ($node_title_list = node_title_list($result)) {
$elements['forum_list'] = $node_title_list;
// $elements['forum_more'] = array(
// '#type' => 'more_link',
// '#url' => Url::fromRoute('forum.index'),
// '#attributes' => array('title' => $this->t('Read the latest forum topics.')),
// );
}
$build = array();
$build['elements']['#markup'] = $elements;
$build['elements']['#markup'] = 'sdfsdafsd';
$build['container']['#markup'] = '<div id="News_images">sdcsadvsdvsd </div>';
// $test = \Drupal::config('nognix.settings')->get('doh_you');
// $build['stuff2']['#markup'] = $this->configuration['content'];
// $build['#attached']['library'][] = 'dd_tools/News';
$build['#attached']['library'][] = 'dd_tools/misc';
return $build;
}