当我在Zend中调用下面的路由器时:
coupon/index/search/cat/1/page/1/x/111/y/222
当我得到控制器内部时$this->_params,我得到一个数组:
array(
'module' => 'coupon',
'controller' => 'index',
'action' => 'search',
'cat' => '1',
'page' => '1',
'x' => '111',
'y' => '222'
)
Run Code Online (Sandbox Code Playgroud)
但我只想得到:
array(
'cat' => '1',
'page' => '1',
'x' => '111',
'y' => '222'
)
Run Code Online (Sandbox Code Playgroud)
你能不能告诉我一个方法来获得所有params刚刚的action?
我有一个问题,如何分析查询以了解其性能(好的或坏的).我经常搜索并获得如下内容:
SELECT count(*) FROM users; => Many experts said it's bad.
SELECT count(id) FROM users; => Many experts said it's good.
请看表:
+---------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+----------------+
| userId | int(11) | NO | PRI | NULL | auto_increment |
| f_name | varchar(50) | YES | | NULL | |
| l_name | varchar(50) | YES | | NULL | |
| user_name | varchar(50) | NO | | …Run Code Online (Sandbox Code Playgroud) crumbInfo/link为面包屑设置Mage :: getBaseUrl()?<layout version="0.1.0">
<contacts_index_index translate="label">
<reference name="breadcrumbs">
<action method="addCrumb">
<crumbName>Accueil</crumbName>
<crumbInfo>
<label>Accueil</label>
<title>Accueil</title>
<link>/</link><!--How can I set Mage::getBaseUrl() here-->
</crumbInfo>
</action>
<action method="addCrumb">
<crumbName>Contactez-nous</crumbName>
<crumbInfo>
<label>Contactez-nous</label>
<title>Contactez-nous</title>
</crumbInfo>
</action>
</reference>
</contacts_index_index>
</layout>
Run Code Online (Sandbox Code Playgroud) 一个*.ini文件具有恒定:APPLICATION_PATH
APPLICATION_PATH何时设置,它是如何工作的?
; application/configs/application.ini
[production]
; PHP settings we want to initialize
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
Run Code Online (Sandbox Code Playgroud) 我配置了两个虚拟主机cuckoo.net,fb.core.net位于本地IP地址(127.0.0.1)
但是当我访问第二个域时:fb.core.net它总是返回第一个域.
请考虑以下配置来帮助我,我真的不知道我在这里错了什么.
<VirtualHost *:80>
DocumentRoot "d:/_iLearning/iCuckoo"
ServerName cuckoo.net
ServerAlias www.cuckoo.net
SetEnv APPLICATION_ENV "development"
<Directory d:/_iLearning/iCuckoo>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "d:/_Devs/fbcore/public"
ServerName fb.core.net
ServerAlias www.fb.core.net
SetEnv APPLICATION_ENV "development"
<Directory d:/_Devs/fbcore/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud) 请为我投票,以下列表中哪一个更好?
我有HTML:
<div id="container">
<button class="btn">Click Here 1</button>
<button class="btn">Click Here 2</button>
<button class="btn">Click Here 3</button>
<button class="btn">Click Here 4</button>
<button class="btn">Click Here 5</button>
<button class="btn">Click Here 6</button>
<!-- A lot of buttons -->
<button class="btn">Click Here n - 2</button>
<button class="btn">Click Here n - 1</button>
<button class="btn">Click Here n</button>
</div>
Run Code Online (Sandbox Code Playgroud)
和jQuery的Javascript是:
$(".btn").click(function(e){
//@todo something here
});
Run Code Online (Sandbox Code Playgroud)
var doSomething = function(e)
{
//@todo something here
}
$(".btn").click(doSomething);
Run Code Online (Sandbox Code Playgroud)
$("#container").click(function(e){
if( $(e.target).is(".btn") )
{
//@todo something here
}
}); …Run Code Online (Sandbox Code Playgroud) 我想替换下面的陈述:
"(?)".replace("?", "$'")
Run Code Online (Sandbox Code Playgroud)
我的期望是:
($')
Run Code Online (Sandbox Code Playgroud)
但结果实际上是:
())
Run Code Online (Sandbox Code Playgroud)
我该如何更正我的代码?
让我说清楚背景:
看看customer_entity桌子:
+-----------+----------------+------------------+------------+----------------------+----------+--------------+----------+---------------------+---------------------+-----------+
| entity_id | entity_type_id | attribute_set_id | website_id | email | group_id | increment_id | store_id | created_at | updated_at | is_active |
+-----------+----------------+------------------+------------+----------------------+----------+--------------+----------+---------------------+---------------------+-----------+
| 1 | 1 | 0 | 1 | john.doe@example.com | 1 | 000000001 | 1 | 2007-08-30 23:23:13 | 2008-08-08 12:28:24 | 1 |
| 2 | 1 | 0 | 1 | vietean@gmail.com | 1 | | 1 | 2011-08-15 09:51:20 | 2011-09-06 07:31:17 | 0 |
+-----------+----------------+------------------+------------+----------------------+----------+--------------+----------+---------------------+---------------------+-----------+
Run Code Online (Sandbox Code Playgroud)
在客户的id为2且 …
我们可以配置Magento设置语言环境语言并使用函数$this->__(string $test)进行翻译.
这个功能怎么样javascript呢?例如,当我使用validation.js和获取一些错误时,它将显示带有我设置的语言环境语言的消息.
validation.js文件位于: src/js/prototype/prototype.js
在文件内部,我们将看到一些东西:
Validation.addAllThese([
['validate-select', 'Please select an option.', function(v) {
return ((v != "none") && (v != null) && (v.length != 0));
}],
['required-entry', 'This is a required field.', function(v) {
return !Validation.get('IsEmpty').test(v);
}],
['validate-number', 'Please enter a valid number in this field.', function(v) {
return Validation.get('IsEmpty').test(v) || (!isNaN(parseNumber(v)) && !/^\s+$/.test(parseNumber(v)));
}]
]
Run Code Online (Sandbox Code Playgroud)
所以,我怎么能翻译的消息This is a required field.,Please select an option.?
我是Zend Framework [版本1]开发人员,现在我正在尝试学习Yii框架.
如何在Yii Framework中获取当前路由器?