Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9297771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:09:19+00:00 2026-06-18T22:09:19+00:00

I have a controller to send send a message from my site: example.com/contact/send-message Ok

  • 0

I have a controller to send send a message from my site:

example.com/contact/send-message

Ok here, but in my API I’ve created the same method:

api.example.com/contact/send-message

in the API should I keep the same method and just call the method inside the controller? When should I use controller methods or api methods?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:09:21+00:00Added an answer on June 18, 2026 at 10:09 pm

    By all means, separate your API logic from your web application logic. One will be used via a web browser, and the other one will just interface with other software. Each of them solves different problems.

    Use a fat model, thin-controller approach. Meaning that all the data processing methods should be placed in your model, not in the controller. From there, you can call those methods either from your API controller, or from your web controller.

    An excellent plugin to build a restful API is Phil Sturgeon’s REST Server

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send data to the Controller from the View. I have a
I have problem to call the method from view to controller. SendVotingPanel.cshtml @model EmailTemplete.Models.SendVotingEmail
I have built a contact form using CakePHP on my site. The controller logic
Here is the set-up: I have a Notifications controller that is called from task
I'm trying to have my class (the caller) send a message to a controller
I have something like: <h:commandButton> <h:ajax event=click listener=#{controller.onLog} onchange=onLogProcess /> .... </h:commandButton> I send
I have an app that allows the user to send a test email from
I am probably over analyzing here, but with all the reading I have done
I'm a newbie in iPhone Programming. I'm trying to send a message from one
my problem is: in the controller I have: var $components = array('Email'); the method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.