Welcome Guest, Not a member yet? Register   Sign In
Ci4 Learn with Myth

This is my first post. I try o learn ci4. I have some big project working on ci3.
Now i have to improve them and also move on ci4.
I have fresh install on centos 8 with composer.
Because i need a complex system admin with roles and many more i decide to use myth. I need to extend Myth because i need to do a phone verification with sms and also mail verification.

I am stuck on how to extend Myth controller with a new method. I don`t want to modify myth\auth\src\controllers\AuthController.php.
I understande i can create app\controllers\AuthController.php but is not working:

PHP Code:
<?php namespace App\Controllers;

Myth\Auth\Controllers\AuthController as MyAuth;

AuthController extends MyAuth
  public function pregister() {
//return $this->_render($this->config->views['pregister'], ['config' => $this->config]);

I also modify 
PHP Code:
public $views = [
'login'   => 'Myth\Auth\Views\login',
'register' => 'Myth\Auth\Views\register',
'pregister' => 'Myth\Auth\Views\register',
'forgot'   => 'Myth\Auth\Views\forgot',
'reset'   => 'Myth\Auth\Views\reset',
'emailForgot' => 'Myth\Auth\Views\emails\forgot',
'emailActivation' => 'Myth\Auth\Views\emails\activation',
Why is not working? What i am doind wrong?

Messages In This Thread
Ci4 Learn with Myth - by cuculetea - 07-23-2021, 06:41 AM
RE: Ci4 Learn with Myth - by InsiteFX - 07-23-2021, 09:09 PM
RE: Ci4 Learn with Myth - by MGatner - 07-24-2021, 05:12 AM
RE: Ci4 Learn with Myth - by ikesela - 07-24-2021, 09:40 AM

Theme © iAndrew 2016 - Forum software by © MyBB