0

I am having troubles inside my action controller. I need to check if (data1 and data2) doesnt exists in the database. If it exist, I want to render a page. If not, render to another page. I dont think that I can use isset in here? can somebody point me to the correct direction? thanks!

2
  • data1 and data2 are attributes of the model? Commented Sep 19, 2013 at 10:29
  • yes sir. @DanielVaquero Commented Sep 19, 2013 at 10:30

1 Answer 1

2

You can check if the table has a attribute with this code:

$existData1 = $model->hasAttribute('data1'); // Return boolean true if the attribute exist in the model table.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.