首页 \ 问答 \ CakePHP链接帮助(CakePHP Link Help)

CakePHP链接帮助(CakePHP Link Help)

如何正确输出span标签: echo $this->Html->link('<span>Log in</span>', '/', array('title' => 'Log in', 'id' => 'login'));

我试过使用&gt; &lt; 而不是<和>但这也不起作用。


How can I get this to output the span tags correctly: echo $this->Html->link('<span>Log in</span>', '/', array('title' => 'Log in', 'id' => 'login'));

I've tried using &gt; &lt; instead of the < and > but that doesn't work either.


原文:https://stackoverflow.com/questions/4788449
更新时间:2023-06-16 21:06

最满意答案

除了在您发现的--env-file docker run (使用-e / --env--env-file )期间设置环境变量外,还有其他可用选项:

  • 使用--link将您的容器链接到(例如)您的couchdb服务器。 如果您的服务器也是一个容器(或者如果您使用大使容器到另一个服务器),这将有效。 链接容器将使一些环境变量可用,包括脚本可以使用的服务器IP和端口。 如果您只需要设置对服务的引用,这将有效。

  • 使用卷 。 Dockerfile中定义的卷可以映射到主机文件夹,因此您可以使用它们来访问配置文件。 这对于非常复杂的配置非常有用。

  • 扩展图像。 您可以根据原始和ADD自定义配置文件或ENV条目创建新映像。 这是灵活性最低的选项,但在复杂配置中非常有用,可以简化启动,特别是当配置主要是静态的时(对于服务/主机名可能是个坏主意,但对于可以为dev / production配置不同的框架)。 可以与上述任何一种结合使用。


In addition to setting environment variables during docker run (using -e/--env and --env-file) as you already discovered, there are other options available:

  • Using --link to link your container to (for instance) your couchdb server. This will work if your server is also a container (or if you use an ambassador container to another server). Linking containers will make some environment variables available, including server IP and port, that your script can use. This will work if you only need to set references to services.

  • Using volumes. Volumes defined in the Dockerfile can be mapped to host folders, so you can use them to access configuration files, for instance. This is useful for very complex configurations.

  • Extending the image. You can create a new image based on your original and ADD custom configuration files or ENV entries. This is the least flexible option but is useful in complex configuration to simplify the launching, specially when the configuration is mostly static (probably a bad idea for services/hostnames, but can work for frameworks that can be configured differently for dev/production). Can be combined with any of the above.

相关问答

更多
  • 我不知道为什么文件大小是213.8。 唯一的大目录是node_modules,它包含.dockerignore,因此它不应该触及该目录。 这不是.dockerignore如何运作。 .dockerignore文件应与Dockerfile位于同一目录中,并列出要忽略的模式。 在backend创建一个名为.dockerignore的文件,该文件只包含node_modules行。 有关更多信息,请参见此处: https : //docs.docker.com/engine/reference/builder/#d ...
  • 除了在您发现的--env-file docker run (使用-e / --env和--env-file )期间设置环境变量外,还有其他可用选项: 使用--link将您的容器链接到(例如)您的couchdb服务器。 如果您的服务器也是一个容器(或者如果您使用大使容器到另一个服务器),这将有效。 链接容器将使一些环境变量可用,包括脚本可以使用的服务器IP和端口。 如果您只需要设置对服务的引用,这将有效。 使用卷 。 Dockerfile中定义的卷可以映射到主机文件夹,因此您可以使用它们来访问配置文件。 这对 ...
  • 我在docker inspect看到“ PortMapping:null ”。 如果未将任何端口映射到其中一个主机,则无法访问所述端口。 请参阅“ 查看我们的Web应用程序容器 ”示例。 文档确实包括: docker run -e WORDPRESS_DB_PASSWORD=password -d --name wordpress --link wordpressdb:mysql -p 127.0.0.2:8080:80 -v "$PWD/":/var/www/html wordpress 注意-p 1 ...
  • 启动和停止容器不会删除容器特定数据。 但是,您可以通过使用新容器替换容器来升级容器。 当发生这种情况时,对容器特定读/写层的任何更改都将丢失,并且新容器将返回其初始状态。 如果在更换容器时要保留容器内的文件,则需要将这些文件存储在卷中,然后将该卷安装在新容器中。 Starting and stopping a container will not delete the container specific data. However, you upgrade containers by replacing ...
  • 此命令将端口8080从docker主机映射到容器的端口80: docker run -d -p 8080:80 cookie-app 该指令告诉你的go应用程序监听容器内的端口8080: http.ListenAndServe(“:8080”,零) 您在上述行中的端口不匹配,您的应用程序没有侦听您要转发到的端口。 要连接到容器的端口8080,可以运行以下命令: docker run -d -p 8080:8080 cookie-app This command maps port 8080 from yo ...
  • 尽管在容器内部使用日志文件(没有卷装)是一种已知的反模式 ,但您可以使用exec轻松输出这些文件,例如cat: docker exec -it [CONTAINERID] cat /usr/src/app/nohup.out 更好的模式是将输出存储到独立的安装在卷上的文件夹中,从容器中删除状态,但也可以让您直接从主机系统访问日志。 在这个特定的情况下,我看不到需要单独的日志文件,甚至不需要nohup。 只需为您的容器设置策略即可自动重新启动它 ( --restart always ),而不是nohup。 ...
  • Docker Toolbox运行docker-daemon运行的虚拟linux机器。 要控制虚拟机,请使用docker-machine命令。 例如,重新启动计算机后, docker-machine start启动计算机,或docker-machine stop以关闭计算机。 还有docker-machine env命令,它将设置docker工作所需的环境变量。 检查输出的底线,它显示如何正确运行命令以设置环境变量。 如果我是正确的,应该在Mac上exec $(docker-machine env) 。 您需 ...
  • 您可以使用docker run --rm -it test_simple bash将shell添加到容器中,然后尝试手动运行nodemon /src/index.js并找出可能出现的问题,以及直接运行node而不是nodemon在调试此问题时。 此外,最好基于官方节点图像 You can use docker run --rm -it test_simple bash to get a shell into the container, then try to run nodemon /src/index. ...
  • 从你的shell运行: eval $(docker-machine env default) 或者您可以在.bash_profile文件中设置相同的内容。 如果只运行docker-machine env default命令,则可以看到env变量: $ docker-machine env default export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/ ...
  • 简单的答案 - debian.8-x64 。 祝你今天愉快。 Simple answer - debian.8-x64. Have a nice day.

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。