Hi, I’m new to expression engine so maybe this is a stupid question or there is a better way to go about it and i’m open to ideas.
I’ve created a plugin that will take parameters and insert data into a custom table i setup in the database. It will then return the id of the row it created in the database or an error message if it couldn’t insert the info into the database.
I would love to somehow be able to set variables somehow (either from the output of the script or somehow inside the plugin to be able to conditionally set something else up
something like:
{exp:academy:add_reservation foo="bar" .... another_variable="another value"}
{if reservation_id == "-1"}
PRINT ERROR MESSAGE
{if:else}
<input type="text" name="reservation_id" value="{reservation_id}"/>
{/if}
{/exp:academy:add_reservation}is that possible? so that iw ould somehow setup the “reservation_id” inside of my plugin to be used like that?
if not is there anyway to retrieve the response from a plugin tag call to be evaluated within either php or just through the template tags?
Usually the way you’d handle this is by creating an {if no_results} type tag. See the comments in the template class docs.
I hope that helps!
You can read about adding conditional variables to your add-on in the development docs. You’ll need to figure out what you want to compare, and make sure that information is run through prep_conditionals so that you can use it in comparisons.
Why Investing in Security Pays Off. Carelessness and misplaced trust often give criminals easy access locksmithcal.com. Even securely locked windows can be relatively simple for experienced burglars to bypass.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.