A
A
agent11562016-09-11 20:40:57
Yii
agent1156, 2016-09-11 20:40:57

js and php how to combine code in a script?

Tell me how to fill in the js yandex api template (Maps).
I have a database that needs to be inserted into js from php, but how?
myPlacemark75 = new ymaps.Placemark([43.073784574497424,44.67815099999991], {
balloonContentHeader: ' CITYLINE ',
balloonContentBody: 'Telmann Address, 49/64а Link ',
}, {
// Options.
// This layout type must be specified.
iconLayout: 'default #image',
// Custom label icon image
iconImageHref: 'images/img49.png',
// Label dimensions
iconImageSize: [30, 30],
// Offset of the upper left corner of the icon relative
// ​​to its "legs" (anchor points).
iconImageOffset: [-3, -42]
});
myMap.geoObjects.add(myPlacemark75);

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2016-09-11
@slo_nik

Good evening.
Try like this

<script>
 var a = <?php echo $b ?>
</script>

E
entermix, 2016-09-11
@entermix

  • Use templating
  • Use PHP Inserts

A
Archakov Dennis, 2016-09-11
@archakov06

Use CMS or write a script that will take data from the database and insert values ​​into the template

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question