上記エラー解決のために AppController.phpに
下記コードを追加したのですが、namespace App\Controller;に赤線で文法エラーのようなものが出ます。
教えて頂きたいのは
①上記エラーの解決に対してこのコードは正しい対策になっているか
②namespace App\Controller;のエラーは何故か
③public function signup()のsignupの位置は動かしたい関数名で良いか。
何卒よろしくお願いします。
namespace App\Controller; use App\Controller\AppController; class UsersController extends AppController{ public function signup(){ } } コード
?php /** * Application level Controller * * This file is application-wide controller file. You can put all * application-wide controller-related methods here. * * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link https://cakephp.org CakePHP(tm) Project * @package app.Controller * @since CakePHP(tm) v 0.2.9 * @license https://opensource.org/licenses/mit-license.php MIT License */ //namespace App\Controller; //App::uses('Controller', 'Controller'); App::uses('AppController','Controller'); class AppController extends Controller { } /** * Application Controller * * Add your application-wide methods in the class below, your controllers * will inherit them. * * @package app.Controller * @link https://book.cakephp.org/2.0/en/controllers.html#the-app-controller */ class UsersController extends AppController { public function index(){ } } ?> コード
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/29 01:31
2019/05/29 01:33
2019/05/29 02:16