У нас вы можете посмотреть бесплатно Part 6: Components & Slots - Laravel 5.4 New Features или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
In Laravel 5.4 we now have a new helper in our blade files to make lives even easier than before. These are called Components and Slots. Components in blade are very similar to components in Vue.js. They allow us to define HTML code for a specific element one time and then just reference it as a completed component. Some of the benefits of using components instead of hardcode is the DRY programming principle (Don't repeat yourself). This way we define a component one time and then just reference the component. We dont need to reduplicate our HTML code for something we use often in an application. Another benefit of components is that if you want to change the style or layout of a component you can make that change once, in the component's blade file, and then every instance of that component around your app will automatically propagate down. So we know that components are awesome, what are slots then? Easy enough, slots are variables and "sections" or "parts" of a component. So we can define a slot for the title, and that way in our component's blade file, we can output the title where it belongs. You can define as many slots as needed in your component and reference them in your component blade file. Just remember to write code in the blade file, that might account for a certain slot missing if its a non-necessary element. I explain this near the end of the video. ------- View this code in a GitHub Gist: https://gist.github.com/jacurtis/0935... -------