TemKa_SD 8 Posted April 15, 2019 Report Share Posted April 15, 2019 Здравствуйте. Я хочу вывести переменную на экран при заходе в модуль приложения. Если в файлах .tpl всё понятно: {{echo "<pre>";}} {{print_r($var);}} {{echo "</pre>";}} {{exit;}} Как работать с print_r в php файлах модулей? Обратиться Quote Link to comment Share on other sites More sharing options...
Павел 143 Posted April 15, 2019 Report Share Posted April 15, 2019 Привет. В php файлах работает такая же конструкция: echo "<pre>"; print_r($var); echo "</pre>"; Обратиться Quote Link to comment Share on other sites More sharing options...
TemKa_SD 8 Posted April 15, 2019 Author Report Share Posted April 15, 2019 1 минуту назад, Павел сказал: Привет. В php файлах работает такая же конструкция: echo "<pre>"; print_r($var); echo "</pre>"; Неа, не хочет. Обратиться Quote Link to comment Share on other sites More sharing options...
Павел 143 Posted April 15, 2019 Report Share Posted April 15, 2019 Почему бы не попробовать как указано в примере? Обратиться Quote Link to comment Share on other sites More sharing options...
TemKa_SD 8 Posted April 15, 2019 Author Report Share Posted April 15, 2019 (edited) 5 часов назад, Павел сказал: Почему бы не попробовать как указано в примере? Там вообще была ошибка синтаксиса, писало что не хватает скобки ) хотя всё правильно было. Это из-за тегов pre так было. Попробовал так сейчас: $var = "123"; echo "<pre>"; print_r($var); echo "</pre>"; ничего не вывело. Edited April 15, 2019 by TemKa_SD Обратиться Quote Link to comment Share on other sites More sharing options...
Павел 143 Posted April 15, 2019 Report Share Posted April 15, 2019 Только что проверил - работает. $var = "123"; echo '<pre>'; print_r($var); echo '</pre>';exit; 1 Обратиться Quote Link to comment Share on other sites More sharing options...
TemKa_SD 8 Posted April 15, 2019 Author Report Share Posted April 15, 2019 Спасибо, нужно было exit указать. 1 Обратиться Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.