php echo从网址中删除斜杠

时间:2017-05-30 12:39:52

标签: php url joomla

我在公司网站上的幻灯片中遇到了一个奇怪的问题,我还没有想到什么是whong。在Joomla更新到3.7.2之后,php回显了我有以下内容的网址:

代替:

header <- dashboardHeader(title = "May 2017", 
                          titleWidth = 525)



sidebar <- dashboardSidebar(disable = TRUE)




frow2 <- fluidRow(

  box(
    title = ""
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    ,dataTableOutput("topTen")
    , height = 640
    , width = 6


  )

  ,box(
    title = ""
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    ,dataTableOutput("topTenMostVuln")
    , height = 640
    , width = 6
  )

)


frow3 <- fluidRow(

  box(
    title = ""
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    ,plotOutput("zscore_chart")
    , height = 600
    , width = 6
  )



  ,box(
    title = "Probabilities by Country and Crisis Type"
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    ,plotOutput("probability_chart")
    , height = 600
    , width = 6


  )
)



frow4 <- fluidRow(

  box(
    title = "Output"
    ,tabBox(
      width = 18
      ,height = 60
      ,id = "dataTabBox"
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )
      ,tabPanel(
        title = ""
        ,dataTableOutput("")
      )

    )
    ,status = "primary"
    ,solidHeader = TRUE 
    ,collapsible = TRUE 
    , height = 880
    , width = 12
  )



)




body <- dashboardBody(frow4, frow3, frow2)

ui <- dashboardPage(header, sidebar, body, skin = "black")


server <- function(input, output) { 

  })



shinyApp(ui, server)

输出:

style="background-image: url("images/sliders/slide-1.jpg");

幻灯片的脚本包含以下Vars:

style="background-image: url(" images sliders slide-1.jpg");

以及在背景图片网址上应用img的行是:

$ctaImg = $helper->get('img');

$ctaBackground  = 'background-image: url("'.$ctaImg.'"); background-attachment: fixed; background-repeat: no-repeat; background-size: cover;';

使用var-dump我有以下输出:

<div class="acm-cta style-5 <?php echo $helper->get('style'); ?> <?php if($ctaImg): echo 'bg-image-large'; endif; ?>" <?php if($ctaImg): echo 'style="'.$ctaBackground.'"'; endif; ?> >

元素:

screenshot - Elements

来源:

screenshot - Sources

在“元素”标签的Chrome中的“开发者工具”中,网址中缺少斜杠,但在“源”中,网址正确无误。它让我发疯了......

1 个答案:

答案 0 :(得分:3)

要修复此问题,您只需要从background-image:url(“”)

中删除引号

在检查器中,您的代码看起来是:

style="background-image: url("/images/sliders/slide-1.jpg");"

并且应该

style="background-image: url(/images/sliders/slide-1.jpg);