小编CI_*_*Guy的帖子

使用tank auth设置Codeigniter HMVC

我无法使用hmvc和tank auth(设置为模块)设置正常工作的Codeigniter版本2.0.3.我已正确安装CI,然后按照这些说明安装HMVC https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home

我到我的欢迎控制器/视图作为示例就好了,这意味着HMVC正在工作.接下来,我尝试通过将tank auth添加到modules文件夹中的文件夹来将tank auth添加到项目中.它具有适当的控制器/视图/模型等.在坦克auth中设置.我甚至在路线中添加了类似的东西

$路线[ "AUTH"] = "auth /中登录";

我还按照指示将auth模块内的控制器扩展到MX_Controller.同样在我的构造函数中:

$this->load->helper(array('form', 'url'));
    $this->load->library('form_validation');
    $this->load->library('security'); <--failing to load this

    $this->load->library('tank_auth');
    $this->lang->load('tank_auth');
     $this->form_validation->CI =& $this;
Run Code Online (Sandbox Code Playgroud)

它似乎重定向到模块,但它出现错误说::

遇到了错误

无法加载请求的类:安全性

我究竟做错了什么?是否有人使用HMVC和tank auth作为模块进行CI安装,以便我可以看到它是如何完成的?我是HMVC的新手,谢谢

codeigniter hmvc tankauth

10
推荐指数
1
解决办法
7000
查看次数

crossbrowser opacity mixin for .less

我试图在LESS中使用Javascript在phpstorm中编译..

我正在尝试基于在此站点上找到的不透明度的跨浏览器实现创建一个函数:link

具体来说,我正在尝试创建一个LESS函数来重新创建这段代码:

.crossbrowseropacity {
    /* Fallback for web browsers that doesn't support RGBa */
    background: rgb(0, 0, 0);
    /* RGBa with 0.6 opacity */
    background: rgba(0, 0, 0, 0.6);
    /* For IE 5.5 - 7*/
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
    /* For IE 8*/
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
}
Run Code Online (Sandbox Code Playgroud)

这就是我在实现它时所拥有的:

.crossbrowser(@color,@alpha){
  @myred:red(@color);
  @mygreen:green(@color);
  @myblue:blue(@color);
  @ievalue:Math.floor(@alpha * 255).toString(16);
  background-color: @color;
  background-color: rgba(@myred,@mygreen,@myblue,@alpha);

/* For IE 5.5 - 7*/

  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#@ievalue+@myred+@mygreen+@myblue, endColorstr=#@ievalue+@myred+@mygreen+@myblue);

  /* For IE 8*/

  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#@ievalue+@myred+@mygreen+@myblue, endColorstr=#@ievalue+@myred+@mygreen+@myblue)";
}
Run Code Online (Sandbox Code Playgroud)

它不会编译正确.有人可以帮我这个吗?

javascript css cross-browser less phpstorm

9
推荐指数
1
解决办法
3603
查看次数

PHPStorm在编辑器中更改diff gutter和折叠箭头的颜色

我最近切换到一个黑暗的主题(Earthsong),并在编辑器中注意到我看不到展开/折叠箭头和编辑器中行号左侧的可点击"差异"链接(不是显示的行编辑器屏幕右侧的行更改).谁知道如何改变两者的颜色?在网上搜索,没有.

php ide colors phpstorm

9
推荐指数
2
解决办法
2822
查看次数

wordpress无法使具有查询的脚本/样式出列

不确定我是否正确措辞但基本上我想在仅使用实际插件的页面上加载插件CSS/JS ..我已经通过插件文件中wp_enqueue_script的插件中使用的任何句柄搜索完成了很多操作.只是wp_dequeue_script在functions.php中

但是,有一些样式的队列包括.php而不是css文件,例如..在插件中它将队列文件排队

wp_enqueue_style("myrp-stuff", MYRP_PLUGIN_URL . "/myrp-hotlink-css.php");
Run Code Online (Sandbox Code Playgroud)

所以我试过了:

wp_dequeue_style('myrp-stuff');
wp_deregister_style('myrp-stuff');
Run Code Online (Sandbox Code Playgroud)

它不起作用

但是,当页面/帖子呈现时,它显示为

<link rel='stylesheet' id='myrp-stuff-css'  href='http://www.modernlogic.co/wp/wp-content/plugins/MyRP/myrp-hotlink-css.php?ver=3.4.2' type='text/css' media='all' />
Run Code Online (Sandbox Code Playgroud)

它将-css添加到id并拒绝出列/取消注册并移动.

我也试过以下没有运气

wp_dequeue_style('myrp-stuff-css');
wp_deregister_style('myrp-stuff-css');
Run Code Online (Sandbox Code Playgroud)

有什么建议?

wordpress wordpress-plugin

8
推荐指数
2
解决办法
6367
查看次数

jquery ajax返回错误但是成功

我有以下JS

function change_ajaxarea1(){
navigator.notification.activityStart();
$('#ajaxarea1').load('http://server.net/droiddev/backbone1/index.php/welcome/', function(){

navigator.notification.activityStop();
$('#ajaxarea1').css("height","auto");
//$('#ajaxarea1').css("overflow","hidden");
});

//navigator.notification.activityStart();
}


function postarticle(){

 $.post("http://server.net/droiddev/backbone1/", { headline: "John", article: "2pm" } );

 }


function addarticle(){

var headlinetemp=$('#headline').val();
var articletemp=$('#article').val();
$.ajax({
type:'POST',
dataType:'json',
url: "http://server.net/droiddev/backbone1/index.php/welcome/addarticle/",
data: { 'headline': headlinetemp, 'article': articletemp},
success:function(){
alert('success');
},
error:function(xhr){
alert(xhr.status);
}



});



}
Run Code Online (Sandbox Code Playgroud)

和以下控制器代码:

  <?php 

class Welcome extends CI_Controller {


    public function index()
    {

    $data['query']=$this->site_model->get_last_ten_articles();
$this->load->view('partial1',$data);

    }

    public function addarticle(){

    $headline=$this->input->post('headline');
    $article=$this->input->post('article');
    $this->site_model->insert_entry($headline,$article);



    }
}
Run Code Online (Sandbox Code Playgroud)

addarticle()javascript ajax工作并将vars发布到服务器和db,然而,javascript将运行错误函数而不是成功函数.http响应代码是200,我认为它会使它运行Success函数.有什么建议?

ajax jquery codeigniter cordova

6
推荐指数
1
解决办法
9486
查看次数

Javascript等待/异步执行顺序

所以我试图把我的头放在 promises/await/async 上。我不明白为什么当执行 go() 时,在 console.log(coffee) 之后会出现带有“finished”的警报。当所有函数都使用 await/promises 时,为什么它只等待 getCoffee() 而其他 axios 调用在“完成”警报之后运行?

function getCoffee() {
  return new Promise(resolve => {
    setTimeout(() => resolve("?"), 2000); // it takes 2 seconds to make coffee
  });
}
async function go() {
  try {
    alert("ok");
    const coffee = await getCoffee();

    console.log(coffee); // ?

    const wes = await axios("https://randomuser.me/api/?results=200");
    console.log("wes"); // using string instead of value for brevity

    const wordPromise = axios("https://randomuser.me/api/?results=200");
    console.log("wordPromise"); // using string instead of value for brevity

    alert("finish");
  } catch …
Run Code Online (Sandbox Code Playgroud)

javascript async-await

5
推荐指数
1
解决办法
3902
查看次数

带有codeigniter后端的phonegap

所以我在使用phonegap方面做得越来越好,但仍然在尝试完全添加codeigniter作为后端.我已经能够从我的CI控制器到我的phonegap android应用程序中加载jquery,但似乎无法向服务器正确提交任何内容.您是否需要休息服务器才能通过phonegap与CI通信?我打算使用ajax帖子向CI发送信息,但到目前为止无法让它工作.我真的很感激有人可以帮助我克服这个障碍.谢谢

链接到相对答案

控制器:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {


    public function index()
    {
        //$this->load->view('welcome_message');
    $data['query']=$this->site_model->get_last_ten_articles();
$this->load->view('partial1',$data);

    }

    public function addarticle(){
    $headline=$this->input->post('headline');
    $article=$this->input->post('article');
    $this->site_model->insert_entry($headline,$article);    

    }
}
Run Code Online (Sandbox Code Playgroud)

Javascript(在phonegap设备上)

function add_article(){



$.ajax({
  type: 'POST',
  url: 'http://testlab.site40.net/droiddev/welcome/addarticle/',
  data: {"headline": "test headline","article": "test article"} 
  error: function(){alert('fail');},
  success: function(data){
   alert('article added');
  },
  dataType: "json"
});

}
Run Code Online (Sandbox Code Playgroud)

ajax jquery json codeigniter cordova

4
推荐指数
1
解决办法
3702
查看次数