I have been working to insert a edit link for each row in a table for that...

function my_sub() { $results = db_query("SELECT * FROM {my_form}");

$header = array(t('NAME'), t('EMAIL-ID'), t('QUESTION-1'), t('QUESTION-2'), t('QUESTION-3'), t('EDIT')); $rows = array();

foreach($results AS $result) { $rows[] = array( $result->name, $result->email, $result->question1, $result->question2, $result->question3, Line 43 - array('data' => new FormattableMarkup('@name', [':link' => $entry['http://localhost:8080/drupal/my_form'], '@name' => $entry['edit']]) ), ); } return theme('table',array('header' => $header, 'rows' => $rows)); }


The problem is Error: Class 'Drupal\Component\Render\FormattableMarkup' not found in my_sub() (line 43 of C:\xampp\htdocs\drupal\sites\all\modules\Fetch_data_db\my_sub.module).

  • Where are you calling my_sub() from? – Clive Jun 12 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.