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 3 years have passed since last update.

CodeIgniter4でシンプルなバッチ処理を作る

Last updated at Posted at 2021-10-31

はじめに

仕事場のCodeIgniter用のバッチが作れないか考えた。バッチ作ってよ!っていきなり言われると思い出せなかったりするよな

参考

Let’s try it: Hello World!

いつものHomeコントローラに処理を作る

app/Controllers/Home.php
<?php

namespace App\Controllers;

use App\Models\VocabularyBookModel;
use CodeIgniter\HTTP\ResponseInterface;

class Home extends BaseController
{
    /**
     * dev\ci4> php public/index.php home message
     * @param $to
     * @return void
     */
    public function message($to = 'World')
    {
        echo "Hello {$to}!" . PHP_EOL;
    }
}

実行

dev\ci4> php public/index.php home message
  Hello World!

image.png

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?