Created
April 2, 2019 17:50
-
-
Save Titoratus/0200602fd58a07f623301cd8fd243acc to your computer and use it in GitHub Desktop.
[OctoberCMS] Замена значений столбца из другой таблицы (список)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| В списке брони нужно изменить значения столбца room (по дефолту это id'шники) на название этого гостиничного номера. | |
| Данные атрибуты у столбца room установить на: | |
| type: partial | |
| path: column_room (можно своё) | |
| Создать файл _column_room.htm в папке того контроллера Room: | |
| <?php | |
| use \path\to\models\Room; | |
| $room = new Room; | |
| $room = Room::select('name') | |
| ->where('id', $value) // $value - это конкретное значение столбца | |
| ->get(); | |
| echo $room[0]->name; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment