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 6884165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:28:25+00:00 2026-05-27T05:28:25+00:00

I’m working on a system (ActiveCollab) that uses Smarty for templates. I want to

  • 0

I’m working on a system (ActiveCollab) that uses Smarty for templates. I want to output some JSON so I need to have it output by itself… no other cruft. However, if I do NOT provide a Smarty template file for the corresponding action I get an error output that ruins the JSON.

Does anyone know how to disable Smarty output on a case by case basis? In pseudocode, something like

$this->smarty->disable();

Failing that, does anyone know how to have ActiveCollab not require a template file for output? Or even know of a better way to output JSON for consumption within ActiveCollab?

My main goal is to output json for use by jqgrid within ActiveCollab, in case that helps.

Thanks.


EDIT:

It turns out it’s as simple as adding die(); after the desired output.

function bar(){
    echo $myoutput;
    die();
}

That’s it. Why I always look for the “hard” answer when the solution is so basic I will never know… sigh.

  • 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-05-27T05:28:25+00:00Added an answer on May 27, 2026 at 5:28 am

    activeCollab will automatically render page layout around page content only if action itself did not provide an exit before it ended execution. This exit may be:

    1. Serving some data with $this->serveData()
    2. Page redirection
    3. Simple printing of content + die()
    4. File forward, using download_file() and download_content() function
    5. Any other exist that stops execution of action (dies within it)

    In your case, you can use controller’s serveData() method to serve JSON:

    function action() {
      $my_json_data = array('something');
    
      $this->serveData($my_json_data, null, FORMAT_JSON);
    }
    

    This function will set proper HTTP headers and encode the value that you are sending.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.