Coder Social home page Coder Social logo

codeeditor's Introduction

codeEditor 可任意嵌入的PHP在线代码编辑器(https://github.com/sam-ke/codeEditor)

客官觉得好用就帮忙给点个星呗 (Star)

用途

以PHP项目为例,假如线上系统出现问题,需要调试的话,一般情况下,我们会添加一些临时代码, 那么必然要经过:测试、提交代码至版本库、部署等一些列操作后才能生效,不仅如此,后期删除 还得走一遍流程,过程繁琐。如果您有这方面的烦恼,那么codeEditor便是您的不二之选

扩展

文本编辑器采用开源公共组件,为了节省空间只保留了php语言解析 其他语言,通过如下链接可获取 https://github.com/ajaxorg/ace-builds/tree/master/src-min-noconflict

接入方式

    /**
    * 在任何一个PHP框架的控制器中,添加如下Action
    * 按照框架规则访问 URL?_token=sdkfdaaafnJHUqoa 即可渲染出编辑器
    */
    public function runcodeAction()
    {
        if($token = $_REQUEST['_token'] == 'sdkfdaaafnJHUqoa'){
        
                //如果是非自动加载,您需要自行require 类库文件ce.php
                //require_once(dirname(__FILE__).'/../../path_to_your_folder/codeEditor/ce.php');
                //note: 必须clone codeEditor 项目到可访问的目录,即 入口文件index.php 同级目录; 或 css、js 等静态资源所处在的目录,
                // 否则渲染页面时,会引起找不到资源的错误
                $ce = new Leb_plugin_codeEditor_ce();
                $ce->show();
            }else{
                dd('未授权');
        }
    }

效果

plot

codeeditor's People

Contributors

sam-ke avatar

Stargazers

小狐狸FM avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.