我正在努力编写可读且易于理解的文档,该文档描述了传递给函数的Array选项的多树结构.
这是一个示例数组结构.
$arr = [
'fields' => [
'title' => [
'name' => 'Document.title',
'format' => 'string',
'readonly' => true
]
]
];
Run Code Online (Sandbox Code Playgroud)
上述数组有许多可能的选项,但这用作理解该结构的函数的参数.
function doSomething(array $arr) { ... }
Run Code Online (Sandbox Code Playgroud)
我想记录如何在PHPDoc中构建数组,但我不确定正确的方法是什么.
这就是我现在拥有的.
/**
* Holds configuration settings for each field in a model.
* Defining the field options
*
* array['fields'] array Defines the feilds to be shown by scaffolding.
* array['fields'][fieldName] array Defines the options for a field, or just enables the field if array is not applied.
* …
Run Code Online (Sandbox Code Playgroud) 我创建了一个测试使用,grep
但它不起作用sed
.
grep -P '(?<=foo)bar' file.txt
Run Code Online (Sandbox Code Playgroud)
这可以通过返回正常工作bar
.
sed 's/(?<=foo)bar/test/g' file.txt
Run Code Online (Sandbox Code Playgroud)
我期待footest
作为输出,但它不起作用.
目前我的所有节点都有ubuntu-yakkety的名称.
docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
d7rdq4n4dmrkhyz4ov7ldr31e ubuntu-yakkety Ready Active
iddxyuic586lnla6aw700rdwc ubuntu-yakkety Ready Active
zxcr1yvveccj4soyh2hsjjebk * ubuntu-yakkety Ready Active Leader
Run Code Online (Sandbox Code Playgroud)
为了创建更好的过滤器,如果我可以将节点的主机名更新为...node-01
node-02
node-99
但是,我在文档中找不到任何方法来完成它.
1)是否可以更新现有Docker节点的主机名?
2)在加入swarm时是否可以为节点命名?
可以检查Elixir中的内存使用情况吗?(也许叫Erlang)
这就是我想要实现的目标:
当我在precced中使用量化时,返回此错误,请参阅多个示例:
printf 'Joe Satriani\nWhitney Houston\n' | grep -Poi '(?<=J\w)[\w\s]+'
e Satriani
printf 'Joe Satriani\nWhitney Houston\n' | grep -Poi '(?<=J\w+)[\w\s]+'
grep: lookbehind assertion is not fixed length
printf 'Joe Satriani\nWhitney Houston\n' | grep -Poi '(?<=J\w{2})[\w\s]+'
Satriani
Run Code Online (Sandbox Code Playgroud)
我不能在预先使用量化?
我可以像绳子一样归还吗?类似的Zend框架 - > __ toString()
在这里我选择我的类别(只是名称)活跃时......
$categories = Mage::getModel('catalog/category')
->getCollection()
->addAttributeToSelect('name')
->addFieldToFilter('is_active', 1);
Run Code Online (Sandbox Code Playgroud)
我希望看到像字符串sql查询"SELECT*..."
我如何从MyController发送变量到我的视图phtml?
Zend框架,我这样发送:
// MyController
$this->view->name = "Matheus";
Run Code Online (Sandbox Code Playgroud)
要么
$this->view->assign('name',"matheus");
Run Code Online (Sandbox Code Playgroud)
// 我的看法
echo $this->name;
Run Code Online (Sandbox Code Playgroud)
在Magento Controller中,我如何从MyController发送到我的视图,以及我如何在视图中看到变量?
谢谢!
我创建了自定义属性,但是当我用我的方法显示它时它不起作用!
看是做...创建我的属性..
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$config = array(
'position' => 1,
'required'=> 0,
'label' => 'Height',
'type' => 'int',
'input' => 'text',
'apply_to' => 'simple,bundle,grouped,configurable'
);
$setup->addAttribute('catalog_product', 'height' , $config);
Run Code Online (Sandbox Code Playgroud)
我收到结帐中的物品清单......
$items = Mage::getModel('checkout/cart')->getQuote()->getAllVisibleItems();
foreach($items as $item){
echo $item->getSku() .'<br/>'; //just test... and all right!
echo $item->getHeight() .'<br/>'; //return empty! or....
echo $item->getData('height') .'<br/>';//return empty!
}
Run Code Online (Sandbox Code Playgroud)
我在后端设置此属性的fiels中的值.
谢谢你的帮助!
magento ×3
grep ×2
regex ×2
cakephp ×1
controller ×1
docker ×1
docker-swarm ×1
elixir ×1
lookbehind ×1
perl ×1
php ×1
phpdoc ×1
sed ×1
view ×1