We know that in the page to insert the picture can use html tag img. In the production of plug-ins, will inevitably use the picture, is not we can also directly in the html code using img? The answer is yes.
Next, let's take a look at how to use the image in the plugin.
Or to the system comes with the bulletin plug-in, for example, we have to add a picture to the plug-in. The following figure is the only simple bulletin plugin with only one plugin file:
Now we have to use the picture in this plug-in, we first in the file on the edge of a new folder, the folder name is called "images", as shown below:
Then we put an image file in the "images" folder, we assume that the picture file name is "announcement.jpg", the next task is that we want to use this picture in the plugin.
We can use "$this->import('images/announcement.jpg')" to insert the picture, the actual code is:
$data = '<img src="'.$this->import('images/announcement.jpg').'">';
Finally, we can put $ data through the built-in function add show.
Is not super simple^_^
Original article, reproduced please specify:How to use images in a plugin | Catfish(鲶鱼) CMS
鲶鱼cms系统5.2.0版以及鲶鱼Blog系统3.2.0版在编辑文章页面新增了上传附件功...
我们在《鲶鱼CMS和鲶鱼Blog怎么自定义注册页面》一文里面介绍了如何通过制作主题文件来...
在实际建站过程中,往往需要进行网站备案,那么当我们备案之后,需要按要求在自己网站上放上备...
鲶鱼Blog系统可以在后台上传升级包进行升级,有些用户可能会很长时间没有升级,这样可能会...
我们在《鲶鱼CMS和鲶鱼Blog怎么自定义登录页面》一文里面介绍了怎么在制作主题的时候自...
我们在《 鲶鱼CMS和鲶鱼Blog怎么自定义登录页面》这一篇里面介绍了如何自己制作一个登...
Management background is composed of five bl...
In the previous section, we talked about how...
In the previous section we talked about how ...
To the last section we have learned to use t...
By the end of the previous section, we have ...