1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

自分用メモ

Last updated at Posted at 2017-08-15

PHPとかデータベースとかあんまりわかってないし、Moodleもそんなに触りたくはないんだけど、自分が使う可能性のある部分だけメモ程度に。随時更新予定。

テスト環境

  • VMware Workstation 12 Player
  • CentOS Linux release 7.3.1611 (Core)
  • Moodle 3.3.1+ (Build: 20170804)
  • XAMPP 7.1.7

データベース

$DB->get_records('接頭辞を除いたテーブル名', array('フィールド名' => value);

version.php

$pluguin->component = 'プラグインの種類_ぷらぐいん'

※languageのファイル名を"プラグインの種類_ぷらぐいん.php"にする。

$PAGE->set_title('ページ名');
$PAGE->navbar->add('ページ名', new moodle_url('index.php'));

echo $OUTPUT->header();

// いろいろ

echo $OUTPUT->footer();
$data = $DB->get_records(table_name, array(field_name => value);
foreach ($data as $key => $value) {
    print $value->表示したいフィールド名;
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?