Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

65
Views
CakePHP4: enlace al archivo Json en script

Tengo una aplicación CakePHP4 donde creo un D3JS WorldMap en una etiqueta <script> . Necesito vincular a un archivo JSON en esta línea d3.json("https://api.jsonbin.io/b/61f8ec14518e5f3b2ab3e218", function(error, topology) { pero esta vez está guardado en webroot folder .

He intentado obtener Path console.log('<?php echo WWW_ROOT; ?>'); pero no funcionó. ¿Cómo puedo configurar la ruta a mi archivo sobre JavaScript?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Cómo puedo configurar la ruta a mi archivo sobre JavaScript?

 path: "<?= $this->Url->build('/my.json', ['fullBase' => true]); ?> " // Output // path: "http://somedomain.com/my.json"

o:

 <div data-json="<?= $this->Url->build('/my.json', ['fullBase' => true]); ?>" ></div>

luego en tu atributo de datos de lectura js

Leer más: https://book.cakephp.org/4/en/views/helpers/url.html

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!