摘要: /** * 求解一个值是否为质数 * * @param $a * @return int 0是 1不是 */ function isPrime($a) { $n=0; if($n>0 && $n<2){ $n=1; }else { $max=$a/2; for ($i=2;$i<=$max;$i++) { ... 阅读全文
posted @ 2017-02-21 10:13 你的左耳耳钉 阅读(1078) 评论(0) 推荐(0) 编辑
摘要: 1、Redis是一个可选的后端缓存解决方案,不过magento2默认使用的是Zend_Cache_Backend_File 2、Zend_Cache_Backend_File的问题 core_cache_tag表不断增长。 如果Magento实例具有多个网站和具有大型目录的网络商店,则该表可在不到一 阅读全文
posted @ 2017-02-19 10:28 你的左耳耳钉 阅读(2000) 评论(1) 推荐(0) 编辑
摘要: 在magento1.9中想要新建一个模块需要在app/code文件中新建一个local文件夹,但是Magento2.x的app目录下是没有code文件的 所以我们需要先创建一个code文件下面放我们的项目目录,大致的目录结构和1.9差不多,不过新增了 1、registration.php(注册文件) 阅读全文
posted @ 2017-02-10 15:18 你的左耳耳钉 阅读(1173) 评论(0) 推荐(1) 编辑
摘要: 在magento2中我们经常会用到php bin\magento 命令:参数 来完成一些操作,所以就对命令做了一个总结 常见的命令如下: php bin/magento list 查看所有命令列表 moudule相关的参数 1、moudule:status 查看所有module的状态 2、moudu 阅读全文
posted @ 2017-02-08 11:13 你的左耳耳钉 阅读(4279) 评论(0) 推荐(0) 编辑
摘要: 语言包下载路径:链接:http://pan.baidu.com/s/1jIwEkb8 密码:4b7p 1、把下载下来的三个文件复制到项目的根目录 2、执行如下代码 ①、如果php不是全局变量就先进入php环境目录(格式如下) ②、如果可以全局使用就进入项目根目录下 php bin\magento s 阅读全文
posted @ 2017-02-07 15:20 你的左耳耳钉 阅读(6480) 评论(0) 推荐(0) 编辑
摘要: 官方下载路径:https://magento.com/tech-resources/downloads/magento; github下载路径:github:https://github.com/magento/magento2 2、可以直接下载zip包或者用git下载 3、下载下来以后把它放在开发 阅读全文
posted @ 2017-02-07 10:39 你的左耳耳钉 阅读(3569) 评论(0) 推荐(0) 编辑
摘要: 1、下载路径: Composer-Setup.exe - it will install the latest composer version whenever it is executed. 2、下载完之后直接安装, 默认安装装就可以(直接next) 3、显示此页面表示安装完成!如果报错 就检查 阅读全文
posted @ 2017-02-06 14:23 你的左耳耳钉 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 参考网站:http://krcodex.blogspot.com/2013/06/get-realted-upsell-cross-sell-product.html Get Related Product Collection $related_product_collection = $_pro 阅读全文
posted @ 2016-12-15 11:29 你的左耳耳钉 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1、在对应的layout上添加一个breadcurmb的block 2、在对应module下的blcok页面的_prepareLayout()方法中添加如下信息 注释:lable就是你要显示的文字(首页、个人中心、我的订单等) 3、在phtml模板中获取breadcrumb 实现的效果图 阅读全文
posted @ 2016-12-14 19:10 你的左耳耳钉 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1、Loading current Layout $this->loadLayout(); 2、Create a new block $block = $this->getLayout->createBlock('block_template_type','test_block_name')->se 阅读全文
posted @ 2016-12-02 10:49 你的左耳耳钉 阅读(180) 评论(0) 推荐(0) 编辑