我在视图/内容中包含此文件sidebar.blade.php
,我想将此(sidebar.blade.php
)文件包含在我的观看home.blade.php
中。
答案 0 :(得分:0)
您是否看过docs?
Blade的@include指令允许您轻松包含Blade视图 从现有视图中。所有可用的变量 父视图将可用于包含的视图:
set(EXTERNAL_PROJECTS "")
set(EXTERNAL_LIBS "")
include(ExternalProject)
# Set compiler(s) per project as required to CMAKE_ARGS in ExternalProject_Add(..).
# -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
# -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
set(EXTERNAL_CMAKE_ARGS -D CMAKE_SYSROOT=${CMAKE_SYSROOT}
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=${CMAKE_FIND_ROOT_PATH_MODE_PROGRAM}
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY}
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE}
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=${CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}
)
set(AIOUSB aiousb)
set(AIOUSB_SRC aiousb_src)
set(EXTERNAL_PROJECTS ${EXTERNAL_PROJECTS} ${AIOUSB_SRC} ${AIOUSB})
set(AIOUSB_SRC_GIT_BRANCH "master")
ExternalProject_Add(${AIOUSB_SRC}
PREFIX ${AIOUSB_SRC}
GIT_REPOSITORY "https://github.com/accesio/AIOUSB.git"
GIT_TAG ${AIOUSB_SRC_GIT_BRANCH}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/${AIOUSB_SRC}/src/${AIOUSB_SRC}/AIOUSB/CMakeLists.txt
INSTALL_COMMAND ""
)
set(AIOUSB_LIBRARY ${CMAKE_BINARY_DIR}/${AIOUSB}/src/${AIOUSB}-build/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${AIOUSB}${CMAKE_STATIC_LIBRARY_SUFFIX})
set(AIOUSBCPP_LIBRARY ${CMAKE_BINARY_DIR}/${AIOUSB}/src/${AIOUSB}-build/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${AIOUSB}cpp${CMAKE_STATIC_LIBRARY_SUFFIX})
ExternalProject_Add(${AIOUSB}
DEPENDS ${AIOUSB_SRC}
PREFIX ${AIOUSB}
DOWNLOAD_COMMAND ""
SOURCE_DIR ${CMAKE_BINARY_DIR}/${AIOUSB_SRC}/src/${AIOUSB_SRC}/AIOUSB
CMAKE_ARGS ${EXTERNAL_CMAKE_ARGS} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DBUILD_SAMPLES:BOOL=OFF -DBUILD_AIOUSB_SHARED:BOOL=OFF -DBUILD_AIOUSBDBG_SHARED:BOOL=OFF -DBUILD_AIOUSBCPP_SHARED:BOOL=OFF
-DBUILD_AIOUSBCPPDBG_SHARED:BOOL=OFF
BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/src/lib/include/${AIOUSB} ${CMAKE_BINARY_DIR}/${AIOUSB}/src/${AIOUSB}-build/lib/libaiousb.a
${CMAKE_BINARY_DIR}/${AIOUSB}/src/${AIOUSB}-build/lib/libaiousbcpp.a
INSTALL_COMMAND rm -rf ${CMAKE_SOURCE_DIR}/src/lib/include/${AIOUSB} && mkdir -p ${CMAKE_SOURCE_DIR}/src/lib/include/${AIOUSB} &&
echo "ln -sr ${CMAKE_BINARY_DIR}/${AIOUSB_SRC}/src/${AIOUSB_SRC}/AIOUSB/lib/*.h ${CMAKE_SOURCE_DIR}/src/lib/include/${AIOUSB}" | bash
)
set(LIBAIOUSB libaiousb)
add_library(${LIBAIOUSB} STATIC IMPORTED)
set_property(TARGET ${LIBAIOUSB} PROPERTY IMPORTED_LOCATION ${AIOUSB_LIBRARY})
add_dependencies(${LIBAIOUSB} ${AIOUSB})
set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LIBAIOUSB})
set(LIBAIOUSBCPP libaiousbcpp)
add_library(${LIBAIOUSBCPP} STATIC IMPORTED)
set_property(TARGET ${LIBAIOUSBCPP} PROPERTY IMPORTED_LOCATION ${AIOUSBCPP_LIBRARY})
add_dependencies(${LIBAIOUSBCPP} ${AIOUSB})
set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LIBAIOUSBCPP})
...
add_dependencies(${PROJECT_NAME} ${EXTERNAL_PROJECTS})
...
also add
target_link_libraries(${PROJECT_NAME} ${EXTERNAL_LIBS} ...)
即使包含的视图将继承可用的所有数据 在父视图中,您还可以将一组额外数据传递给包含的数据 视图:
@include('shared.errors')