Welcome Guest, Not a member yet? Register   Sign In
How to use view() for Authentication Actions?
#1

(This post was last modified: 12-22-2024, 07:28 AM by 4usol.)

Hi,

i want to customize the view/layout for each view-file.

For that in my case i have to change the controllers to change the original way to render the viewfiles from 
"$this->view(setting('Auth.views')['register']);"
to
"$this->template(setting('Auth.views')['register'], array(), array('title'=>'mytext - '.lang('Auth.register')), array('mode'=>'fullpage')); "

For the "normal" pages lik login or register all is fine.

For the special auth-actions for example "email_activate_show" i coulnd find the part where the view file is called to render. At the moment i cannot use my "template" function to render the view.

At the moment only the content of the "email_activate_show" will show but i want to chang this to my own function but i dont now where is the part for that.

Where i find the part for this or how i can render the auth-action view files in the same way like all others?

I see the ActionController and here this part
" public function show()
    {
        return $this->action->show();
    }"

My try to override/extend the actioncontroller in the same way like the login oder registrationcontroller doesnt work
"namespace App\Controllers\Shield;
use CodeIgniter\Shield\Controllers\RegisterController as ShieldAction;
use CodeIgniter\HTTP\RedirectResponse;


/**
* Class RegisterController
*
* Handles displaying registration form,
* and handling actual registration flow.
*/
//class RegisterController extends BaseController
class ActionController extends ShieldAction
{
    /**
    * Shows the initial screen to the user to start the flow.
    * This might be asking for the user's email to reset a password,
    * or asking for a cell-number for a 2FA.
    *
    * @return Response|string
    */
    public function show()
    {
        return $this->template( $this->action->show(), array(), array('title'=>'mytext - '.lang('Auth.register')), array('mode'=>'fullpage')); 
        //return $this->action->show();
    }

}"
(Hope it's clear what i mean - sorry if its not)



https://shield.codeigniter.com/reference...h_actions/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB