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

  • Home
  • SEARCH
  • 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 8829887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:56:18+00:00 2026-06-14T07:56:18+00:00

I am writing a utility method that makes an API call to get data,

  • 0

I am writing a utility method that makes an API call to get data, then populating a view file w/ that data:

// decode API response
$response = json_decode($sa->response);
// pass data to view
$this->view->paf = $response->response;
// NEED TO GET HTML HERE INSTEAD OF DISPLAYING VIEW
$this->_helper->layout->setLayout('print-nosubmit');

What actually happens is that the response is decoded and the view (‘print-nosubmit’) is then displayed w/ the data in $response. That is all well and good EXCEPT I do not want to display the view. I still need to get the view populated w/ the data but it is only to get the HTML (not just the html from ‘print-nosubmit’ but the html from that file AFTER it gets the data) to pass along to DOMPDF for PDF creation. I am (obviously) going about this the wrong way since I don’t actually want to load the layout but I don’t know of a good way to get the data in $response to that view and then only get back the raw HTML.

I am sure there is an approach I can take to accomplish this task but I need a pointer in the right direction.

Thanks!

* Update: Just to make things more clear, ‘print-nosubmit’ is a VIEW file and is located in /views/scripts/print-nosubmit.phtml.

  • 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-14T07:56:19+00:00Added an answer on June 14, 2026 at 7:56 am

    After trying just about everything I could think of I found a solution:

    $this->_helper->layout()->disableLayout();
    $this->_helper->viewRenderer->setNoRender(true);
    $this->view->addScriptPath(APPLICATION_PATH . '/layouts/scripts/'); //default layout path
    $html = $this->view->render('print-nosubmit.phtml');
    

    I now have the entire HTML contents of what print-nosubmit.phtml generates after it is rendered w/ the data stored in $html.

    Huzzah!

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

Sidebar

Related Questions

I'm writing a little utility that starts with selecting a file, and then I
I am writing a small file download utility. The DownloadFile() method is called on
I am writing a utility that will zip a file (or set of files)
I'm writing a utility program with C# in WPF that allows users to create
I am writing a utility that would allow me to monitor the health of
I'm writing a little utility to load Entity Data Models from an assembly and
I find myself writing file and directory utility functions all the time, and I
I am writing a simple DOS utility that uses the findstr utility to search
Okay, so I'm writing a utility that compares 2 XML documents using Microsoft's XML
I frequently find myself writing utility classes that can be re-used throughout my projects.

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.