我有一个在Kohana 3路由中定义的规则,但ID参数未传递给该方法.
我在bootstrap.php文件中有这个:
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'home',
'action' => 'index',
));
Run Code Online (Sandbox Code Playgroud)
和控制器
public function action_home($id=NULL)
{
echo $id;
}
Run Code Online (Sandbox Code Playgroud)
但在以下链接示例中,ID通常为NULL:
ID应该是,123但事实并非如此.我不知道为什么.
我正在使用magento 1.7.2,我想添加日期属性和时间,这样可以保存日期以及数据库中该产品的时间.
我试过这个代码在我的模块中使用mysql-setup文件添加新属性.
$setup->addAttribute('catalog_product', 'new_date', array(
'group' => 'General',
'input' => 'date',
'type' => 'datetime',
'label' => 'New Date',
'backend' => 'eav/entity_attribute_backend_datetime',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'searchable' => 1,
'filterable' => 1,
'comparable' => 1,
'visible_on_front' => 1,
'visible_in_advanced_search' => 0,
'is_html_allowed_on_front' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
Run Code Online (Sandbox Code Playgroud)
但这只给我选择时间的日期.
请帮我.
谢谢.