Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @file
- * @author Rakesh James (Modified by JP)
- * Contains \Drupal\example\Controller\ExampleController.
- * Please place this file under your example(module_root_folder)/src/Controller/
- */
- namespace Drupal\example\Controller;
- /**
- * Provides route responses for the Example module.
- */
- class ExampleController
- {
- /**
- * Returns a simple page.
- *
- * @return array
- * A simple renderable array.
- */
- public function myPage()
- {
- $toPage = " ";
- $group = "";
- db_set_active('001');
- $result = db_query("SELECT * FROM fav_links join fav_links_grp1 on flg1_code = fl_grp order by fl_grp");
- foreach ($result as $record)
- {
- if ($group <> $record->fl_grp)
- {
- $toPage = "$toPage<br><b>$record->flg1_name</b>";
- }
- $toPage = "$toPage<br><a href=\"$record->fl_url\">$record->fl_name</a>";
- $group=$record->fl_grp;
- }
- db_set_active();
- $element = array(
- '#markup' => t($toPage),
- );
- return $element;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement