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

Displaying Errors

Development and Programming

viewcreative's avatar
viewcreative
116 posts
16 years ago
viewcreative's avatar viewcreative

Displaying Errors

Hi,

I’m currently writing an extension for a client project that requires a heavily modified member registration system - So far so good.

As the registration criteria for this project is somewhat different to the EE defaults, I need to to validate the input and check for required fields - no problem.

My question is, how would I go about raising / displaying a (validation) error through EE?

I’m looking for something along the lines of

display_error("error message here");

But can’t seem to find anything in the documentation.

Thanks in advance.

M

– edited to add “Display Errors” to top of post to aid searching (as search doesn’t search titles!) –

       
viewcreative's avatar
viewcreative
116 posts
16 years ago
viewcreative's avatar viewcreative

Ok, I’ve just had a dig around in the DISPLAY and OUTPUT classes and found the following:

$OUT->fatal_error();
$OUT->show_message();
$OUT->show_user_error();

// ...and...

$DSP->error_message();

Any pointers on which/when I should/shoudn’t use?

Thanks in advance.

       
viewcreative's avatar
viewcreative
116 posts
16 years ago
viewcreative's avatar viewcreative
$OUT->show_user_error("submission","Some Error");

Seems to have the desired effect!

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
16 years ago
Robin Sowell's avatar Robin Sowell

Yeppers- output class is the way to go on this one. (Display class is used for the backend cp layout stuff.)

       
viewcreative's avatar
viewcreative
116 posts
16 years ago
viewcreative's avatar viewcreative

Thanks Robin.

       

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.