自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(26)
  • 收藏
  • 关注

原创 PHP通过类名 怎么查找 这个类所在的文件 路径?利用PHP反射类

class counter { static $c = 0; return $c++; }// Create an instance of the Reflection_Function class $func = new ReflectionClass('counter');echo $func->getFileName();

2015-06-25 12:31:30 6633

转载 CSS3手风琴效果

垂直手风琴 .accordionMenu { background: #fff; color: #424242; font: 12px Arial, Verdana, sans-serif; margin: 0 auto; padding: 10px;

2015-06-24 14:02:20 919

原创 PHP正则把"2010-12-20"替换成"12/20/2010"

//替换时引用捕获分组preg_replace('/(\d{4})-(\d{2})-(\d{2})/',"${2}/${3}/${1}","2010-12-20"); // "12/20/2010"//推荐下面这种 $num 记法preg_replace('/(\d{4})-(\d{2})-(\d{2})/',"${2}/${3}/${1}","2010-12-20"); // "12/20

2015-06-19 16:19:27 421

原创 PHP正则匹配汉字字符/中文字符

preg_match('/[\x{4e00}-\x{9fff}]/u','我')

2015-06-19 15:52:48 3542

原创 JS垮浏览器取得页面视口的大小

//垮浏览器取得页面视口的大小 var pageWidth = window.innerWidth, pageHeight = window.innerHeigth; if(typeof pageWidth != "number"){ if(document.compactMode == "CSS1Compat"){ pageWidth = document.documentElem

2015-06-18 14:56:39 2769

原创 JS垮浏览器取得窗口左边和上边的位置

var leftPos = (typeof window.screenLeft == "number") ? window.screenLeft : window.screenX; var topPos = (typeof window.screenTop == "number") ? window.screenTop : window.screenY;

2015-06-18 14:43:22 990

原创 获取plist文件的全路径

NSString *path = [[NSBundle mainBundel] pathForResource:@"app.plist" ofType:nil];

2015-06-17 20:37:31 556

原创 JS里的工厂模式和构造函数模式

//js的工厂模式 function createPerson(name,age,job){ var o = new Object(); o.name = name; o.age = age; o.job = job; o.sayName = function(){alert(this.name);}; return o; } //js的构造函数模式 fu

2015-06-17 15:51:07 2379

原创 Magento中 可配置产品 价格不根据选项变化

1.浏览器查看jsvar spConfig = new Product.Config({    "attributes": {        "502": {            "id": "502",            "code": "shoe_size",            "label": "Shoe Size",            "opt

2015-06-16 17:08:26 833

原创 Magento产品详情页获取产品的库存

/*获取库存具体数量 2015年3月23日*/$qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty();/**@date 2015年6月16日 * 判断是否的可配置产品 */if($_product -> isConfigurable ()){ $

2015-06-16 13:02:01 1310

原创 Linux zip命令 与 windows的兼容问题

注意:关于zip命令,因为 Windows 系统与 Linux/Unix 在文本文件格式上的一些兼容问题,比如换行符(为不可见字符),在 Windows 为 CR+LF(Carriage-Return+Line-Feed:回车加换行),而在 Linux/Unix 上为 LF(换行),所以如果在不加处理的情况下,在 Linux 上编辑的文本,在 Windows 系统上打开可能看起来是没有换行的。如果你

2015-06-15 16:33:58 2503

原创 JS字符串的一些常用方法

//【String类型】 //1.返回给定位置的那个字符 var stringValue = "hello world"; alert(stringValue.charAt(1)); //"e" //如果你想得到是不是字符而是字符编码 var stringValue = "hello world"; alert(stringValue.charCodeAt(1)); //输出"

2015-06-13 16:58:18 560

原创 JS函数中的 apply() 和 call()

//【JS函数属性和方法】 //1.length属性,表示函数希望接收的参数的个数 function sayName(name){ alert(name); } function sum(num1,num2){ return num1 + num2; } alert(sayName.length); //1 alert(sum.length); //2 //

2015-06-12 16:15:35 418

原创 JS函数内部属性:arguments

//1.arguments是一个类数组对象,包含着传入函数中的所有参数。主要用途是保存函数参数,但这个对象还有一个名叫callee的属性 //该属性是一个指针,指向拥有这个arguments对象的函数。 //请看下面非常经典的阶乘函数 function fuctorial(num){ if(num<=1){ return 1; }else{ return num *fu

2015-06-12 15:44:11 1208

原创 Magento 根据SKU查询订单信息的SQL语句

/*根据SKU,查询订单信息*/ SELECT order_table.increment_id,item_table.created_at,item_table.sku, order_table.customer_email, CONCAT_WS('',order_table.customer_firstname,order_table.customer_middlename,o

2015-06-12 15:21:24 1214

原创 JS中给数组对象排序

//JS中给数组对象排序 //假设有一个对象数组,我们想要根据某个对象属性对数组进行排序。而传递给数组sort()方法的比较函数要接收2个参数,即要比较的值。 //可是,我们需要一种方式指明按照哪个属性来排序。 //要解决这个问题,可以定义一个函数,它接收一个属性名,然后根据这个属性名来创建一个比较函数。 function createComprisonFunction(propert

2015-06-12 14:56:31 3195 1

原创 PHP中正则函数

//1.搜索字符串:preg_grep()函数搜素数组中的所有元素,返回由与某个模式匹配的所有元素组成的数组$lan = array('php','asp','jsp','python','ruby');var_dump(preg_grep('/p$/',$lan)); //array(3) { [0]=> string(3) "php" [1]=> string(3) "asp" [2]=>

2015-06-10 15:52:50 1024

原创 Magento根据产品SKU查询产品库存状态

//根据SKU查询产品库存状态 $product = Mage::getModel('catalog/product')->loadByAttribute('sku','HB400'); $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product

2015-06-10 09:13:17 1714

转载 如何在magento模板文件中获取controller名称,action名称和module name

/*** get Controller name*/$this->getRequest()->getControllerName();/*** get Action name, i.e. the function inside the controller*/$this->getRequest()->getActionName();/*** get module name*/

2015-06-09 14:28:09 838

原创 Magento使用phpexcel导出 商品订单 /订单条目表sales_flat_order_item

<?php/** * 导出商品订单(订单条目表sales_flat_order_item) * @date 2015年6月9日 */define('MAGENTO', realpath(dirname(__FILE__)));require_once MAGENTO . '/app/Mage.php';umask(0);Mage::app()->setCurrentStore(M

2015-06-09 13:54:33 1982

原创 JS数组的常用方法总结

//【检测数组】 //1.对于一个网页,或者一个全局作用域而言,使用instaceof操作符 if(value instanceof Array){ //todo... } //2.如果网页中包含多个框架,那实际上存在2个以上不同的全局执行环境 //ECMAScipt5新增了 Array.isArray()方法,最终确定某个值到底是不是数组,而不管它在哪个全局执行环境中创建的

2015-06-04 16:54:57 437

转载 使用phpexcel导出到xls文件的时候出现乱码解决【已解决】

<?phpinclude 'global.php';$ids = $_GET['ids'];$sql = "select * from crm_cost_end where id in ( {$ids} )";$result = $db->findAll($sql);//echo $result[1]['sn'];//创建一个excel对象$objPHPExcel = new P

2015-06-04 10:36:57 2284 1

原创 Magento中使用原生SQL

$sql = "SELECT ...";$handle = Mage::getSingleton('core/resource')->getConnection('core_write');$query = $handle->query($sql);while ($row = $query->fetch()) { //...}

2015-06-03 17:12:33 443

原创 第四章 变量、作用域和内存问题

js变量可以用来保存2种类型的值:基本类型值和引用类型值。基本数据类型有5种:Undefined、Null、Boolean、Number和String。1.基本类型值在内存中占据固定大小的空间,因此被保存在栈内存中。2.从一个变量向另一个变量复制基本类型的值,会创建这个值的副本。3.引用类型的值是对象,保存在堆内存中。4.包含引用类型值的变量实际上包含的并不是对象本身,而是一个指向

2015-06-03 12:03:02 444

原创 MySQL查询某个数据库的所有表和表中有多少行

use information_schema;select table_name,table_rows from tables where TABLE_SCHEMA = 'databaseName' order by table_rows desc;

2015-06-01 17:15:20 6115

原创 Magento后台上传excel批量生成订单

1. \app\design\adminhtml\default\default\template\sales\order\create\from.phtml getUrl('*/Sales_Order_Create/upload') ?>" method="post" enctype="multipart/form-data"> getBlockHtml('formk

2015-06-01 13:11:14 1022

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除