We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE3 Module - CP View Alert

How Do I?

anthony.pinskey's avatar
anthony.pinskey
7 posts
8 years ago
anthony.pinskey's avatar anthony.pinskey

Hi everyone!

In the midst of setting up a module, I have a form that is getting submitted to update settings. I want to display a success alert. I am having trouble figuring out how to go about the process with the CP/Alert Service.

My forms action is the following method:

public function save()
    {
       // Grab post input above and update database schema etc

        ee('CP/Alert')->makeInline('alert')
          ->asSuccess()
          ->withTitle('Title test')
          ->addToBody('Description test')
          ->now();

        ee()->functions->redirect($this->mcp_link);
    }

But after being redirected to the main view, I see no notifications or alerts. What else needs to be added or returned to the view to display the message and what exactly is the process as it seems the setup is different from the flash messages in EE 2.X

I feel like something needs to be returned to the view and then check if there is a message to render or not.

Thanks in advance for any help!

       
anthony.pinskey's avatar
anthony.pinskey
7 posts
8 years ago
anthony.pinskey's avatar anthony.pinskey

Hey all!

I just found the issue. I wasn’t using the Shared Form View.

Found the documentation here: https://docs.expressionengine.com/latest/development/shared_form_view.html

Everything makes sense now. Thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.