@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | # 引数から$offsetに値が渡されます。これは、3番目のURIセグメントの値です。 |
| 25 | 25 | # ユーザが変更可能なデータですので、int型へ変換し、必ず整数値にします。 |
| 26 | - $offset = (int) $offset; |
|
| 26 | + $offset = (int)$offset; |
|
| 27 | 27 | |
| 28 | 28 | # 新しい記事ID順に、limit値とoffset値を指定し、bbsテーブルから記事データ |
| 29 | 29 | # (オブジェクト)を取得し、$data['query']に代入します。order_by()メソッドは、 |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $vals = [ |
| 115 | 115 | 'word' => random_string('numeric', 4), |
| 116 | 116 | 'img_path' => './captcha/', |
| 117 | - 'img_url' => base_url() . 'captcha/' |
|
| 117 | + 'img_url' => base_url().'captcha/' |
|
| 118 | 118 | ]; |
| 119 | 119 | $cap = create_captcha($vals); |
| 120 | 120 | $data = [ |
@@ -141,12 +141,12 @@ discard block |
||
| 141 | 141 | public function delete($id = '') |
| 142 | 142 | { |
| 143 | 143 | # 第1引数、つまり、3番目のURIセグメントのデータをint型に変換します。 |
| 144 | - $id = (int) $id; |
|
| 144 | + $id = (int)$id; |
|
| 145 | 145 | # POSTされたpasswordフィールドの値を$passwordに代入します。 |
| 146 | 146 | $password = $this->input->post('password'); |
| 147 | 147 | # POSTされたdeleteフィールドの値を$deleteに代入します。この値が |
| 148 | 148 | # 1の場合は、削除を実行します。1以外は、削除の確認ページを表示します。 |
| 149 | - $delete = (int) $this->input->post('delete'); |
|
| 149 | + $delete = (int)$this->input->post('delete'); |
|
| 150 | 150 | |
| 151 | 151 | # 削除パスワードが入力されていない場合は、エラーページを表示します。 |
| 152 | 152 | if ($password == '') |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | # 有効期限を2時間に設定し、それ以前に生成されたキャプチャをデータベースから |
| 279 | 279 | # 削除します。delete()メソッドの第2引数では、「captcha_time <」を配列のキーに |
| 280 | 280 | # していますが、このように記述することで、WHERE句の条件の演算子を指定できます。 |
| 281 | - $expiration = time() - 7200; // 有効期限 2時間 |
|
| 281 | + $expiration = time() - 7200; // 有効期限 2時間 |
|
| 282 | 282 | $this->db->delete('captcha', ['captcha_time <' => $expiration]); |
| 283 | 283 | |
| 284 | 284 | # バリデーション(検証)クラスより引数$strに渡された、ユーザからの入力値がデータ |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | # 携帯端末の場合は、「_mobile」がファイル名に付くビューファイルをロードします。 |
| 314 | 314 | if ($this->agent->is_mobile()) |
| 315 | 315 | { |
| 316 | - $this->load->view($file . '_mobile', $data); |
|
| 316 | + $this->load->view($file.'_mobile', $data); |
|
| 317 | 317 | } |
| 318 | 318 | else |
| 319 | 319 | { |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | class Shop extends MY_Controller { |
| 14 | 14 | |
| 15 | - public $limit; // 1ページに表示する商品の数 |
|
| 16 | - public $admin; // 管理者のメールアドレス |
|
| 15 | + public $limit; // 1ページに表示する商品の数 |
|
| 16 | + public $admin; // 管理者のメールアドレス |
|
| 17 | 17 | |
| 18 | 18 | public function __construct() |
| 19 | 19 | { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | # モデルよりそのカテゴリの商品数を取得し、ページネーションを生成します。 |
| 69 | 69 | $this->load->library('generate_pagination'); |
| 70 | - $path = '/shop/index/' . $cat_id; |
|
| 70 | + $path = '/shop/index/'.$cat_id; |
|
| 71 | 71 | $total = $this->inventory_model->get_product_count($cat_id); |
| 72 | 72 | $data['pagination'] = $this->generate_pagination->get_links($path, $total, 4); |
| 73 | 73 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | ); |
| 150 | 150 | |
| 151 | 151 | # 検索キーワードをクエリ文字列から取得します。 |
| 152 | - $q = (string) $this->input->get('q'); |
|
| 152 | + $q = (string)$this->input->get('q'); |
|
| 153 | 153 | # 全角スペースを半角スペースに変換します。 |
| 154 | 154 | $q = trim(mb_convert_kana($q, 's')); |
| 155 | 155 | # 検索キーワードを検証します。 |
@@ -168,13 +168,13 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | # ページネーションを生成します。 |
| 170 | 170 | $this->load->library('generate_pagination'); |
| 171 | - $path = '/shop/search'; |
|
| 171 | + $path = '/shop/search'; |
|
| 172 | 172 | $data['pagination'] = $this->generate_pagination->get_links($path, $total, 3); |
| 173 | 173 | |
| 174 | 174 | $data['q'] = $q; |
| 175 | 175 | $data['total'] = $total; |
| 176 | 176 | |
| 177 | - $data['main'] = 'shop_search'; |
|
| 177 | + $data['main'] = 'shop_search'; |
|
| 178 | 178 | $data['item_count'] = $this->cart_model->count(); |
| 179 | 179 | $this->twig->display('shop_tmpl_shop', $data); |
| 180 | 180 | } |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Migration: Create_bbs |
|
| 4 | - * |
|
| 5 | - * Created by: Cli for CodeIgniter <https://github.com/kenjis/codeigniter-cli> |
|
| 6 | - * Created on: 2015/05/12 06:00:24 |
|
| 7 | - */ |
|
| 3 | + * Migration: Create_bbs |
|
| 4 | + * |
|
| 5 | + * Created by: Cli for CodeIgniter <https://github.com/kenjis/codeigniter-cli> |
|
| 6 | + * Created on: 2015/05/12 06:00:24 |
|
| 7 | + */ |
|
| 8 | 8 | class Migration_Create_bbs extends CI_Migration { |
| 9 | 9 | |
| 10 | 10 | public function up() |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | # 携帯端末からのアクセスを判定するためユーザエージェントクラスをロードします。 |
| 28 | - $agent =& load_class('User_agent'); |
|
| 28 | + $agent = & load_class('User_agent'); |
|
| 29 | 29 | |
| 30 | 30 | # 携帯端末からの入力文字エンコードを変換します。 |
| 31 | 31 | if (count($_POST) > 1 && $agent->is_mobile()) |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | return; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if (! $this->check_route()) { |
|
| 44 | + if ( ! $this->check_route()) { |
|
| 45 | 45 | return; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | // load_class()でuser_agentをロードしたため、$this->user_agentとして |
| 49 | 49 | // して代入されているので、それを$this->agentに変更する |
| 50 | - $CI =& get_instance(); |
|
| 50 | + $CI = & get_instance(); |
|
| 51 | 51 | $CI->agent = $CI->user_agent; |
| 52 | 52 | unset($CI->user_agent); |
| 53 | 53 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | public function get_links($path, $total, $uri_segment) |
| 9 | 9 | { |
| 10 | 10 | # ページネーションクラスをロードします。 |
| 11 | - $this->CI =& get_instance(); |
|
| 11 | + $this->CI = & get_instance(); |
|
| 12 | 12 | $this->CI->load->library('pagination'); |
| 13 | 13 | |
| 14 | 14 | $config = []; |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * 『CodeIgniter徹底入門』のサンプルアプリケーションをCodeIgniter 3.0にアップデート |
|
| 4 | - * |
|
| 5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | - * @license BSD 3-Clause License |
|
| 7 | - * @copyright 2015 Kenji Suzuki |
|
| 8 | - * @link https://github.com/kenjis/codeigniter-tettei-apps |
|
| 9 | - */ |
|
| 3 | + * 『CodeIgniter徹底入門』のサンプルアプリケーションをCodeIgniter 3.0にアップデート |
|
| 4 | + * |
|
| 5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | + * @license BSD 3-Clause License |
|
| 7 | + * @copyright 2015 Kenji Suzuki |
|
| 8 | + * @link https://github.com/kenjis/codeigniter-tettei-apps |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | class Seeder |
| 12 | 12 | { |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | public function __construct() |
| 18 | 18 | { |
| 19 | - $this->CI =& get_instance(); |
|
| 19 | + $this->CI = & get_instance(); |
|
| 20 | 20 | $this->CI->load->database(); |
| 21 | 21 | $this->CI->load->dbforge(); |
| 22 | 22 | $this->db = $this->CI->db; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function call($seeder) |
| 32 | 32 | { |
| 33 | - $file = APPPATH . 'database/seeds/' . $seeder . '.php'; |
|
| 33 | + $file = APPPATH.'database/seeds/'.$seeder.'.php'; |
|
| 34 | 34 | require_once $file; |
| 35 | 35 | $obj = new $seeder; |
| 36 | 36 | $obj->run(); |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Part of CodeIgniter Simple and Secure Twig |
|
| 4 | - * |
|
| 5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | - * @license MIT License |
|
| 7 | - * @copyright 2015 Kenji Suzuki |
|
| 8 | - * @link https://github.com/kenjis/codeigniter-ss-twig |
|
| 9 | - */ |
|
| 3 | + * Part of CodeIgniter Simple and Secure Twig |
|
| 4 | + * |
|
| 5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
| 6 | + * @license MIT License |
|
| 7 | + * @copyright 2015 Kenji Suzuki |
|
| 8 | + * @link https://github.com/kenjis/codeigniter-ss-twig |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | // If you don't use Composer, uncomment below |
| 12 | 12 | /* |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | $twig = new \Twig_Environment($this->loader, [ |
| 55 | - 'cache' => APPPATH . '/cache/twig', |
|
| 55 | + 'cache' => APPPATH.'/cache/twig', |
|
| 56 | 56 | 'debug' => $debug, |
| 57 | 57 | 'autoescape' => TRUE, |
| 58 | 58 | ]); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function display($view, $params = []) |
| 81 | 81 | { |
| 82 | - $CI =& get_instance(); |
|
| 82 | + $CI = & get_instance(); |
|
| 83 | 83 | $CI->output->set_output($this->render($view, $params)); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | $this->createTwig(); |
| 96 | 96 | |
| 97 | - $view = $view . '.twig'; |
|
| 97 | + $view = $view.'.twig'; |
|
| 98 | 98 | return $this->twig->render($view, $params); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | public function __construct() |
| 8 | 8 | { |
| 9 | - $this->CI =& get_instance(); |
|
| 9 | + $this->CI = & get_instance(); |
|
| 10 | 10 | $this->CI->load->library('form_validation'); |
| 11 | 11 | |
| 12 | 12 | $this->set_validation_rules(); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | public function __construct() |
| 8 | 8 | { |
| 9 | - $this->CI =& get_instance(); |
|
| 9 | + $this->CI = & get_instance(); |
|
| 10 | 10 | $this->CI->load->library('form_validation'); |
| 11 | 11 | } |
| 12 | 12 | |