open a view in a new tab

Asked

Viewed 366 times

4

I have a view with a chart, but I don’t want it to open inside my template and yes in a new aba.

$this->loadGrafico('graficoEscola', $grafico);
  • There’s an answer to what you’re looking for. I think this helps you to solve your problem https://stackoverflow.com/questions/32778670/codeigniter-load-view-in-new-tab

1 answer

1

You have to add the attribute target tag anchor <a> and assign the value of the attribute as _blank to open in a new aba.

It would be something like:

<a target="_blank" href='graficoEscola'>$grafico</a>

In the form itself, you can get the same result:

<form action="#" method="get" target="_blank">
    ...
</form>
  • I am using MVC. When I receive the data from a form via get I call a function that returns a query and send this result via array($graphic) to my view that generates a chart. ?

  • Use target in your template.

  • I didn’t understand a thing. I have a form where I fill in some data that serves as parameters in my query and with that I get the data to generate a graph. When I receive this data I am loading the visualization of this graph using $ this-> load-> view (); Do you understand? I just don’t know how to load this visualization into another tab. How to make $this->loadGrafico('graphicSchool', $graphic); open in a new tab outside of my template?

  • Edited response. I hope it helps. I also recommend that you take a look at the link provided in @Joseribamar’s reply.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.