小编Dim*_*ero的帖子

Kohana 3路由中的ID参数为NULL

我有一个在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:

http://example.com/index/123

ID应该是,123但事实并非如此.我不知道为什么.

php routing bootstrapping kohana-3

1
推荐指数
1
解决办法
736
查看次数

如何在后端magento中添加timepicker的时间

我正在使用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)

但这只给我选择时间的日期.

请帮我.

谢谢.

php datepicker magento

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

php ×2

bootstrapping ×1

datepicker ×1

kohana-3 ×1

magento ×1

routing ×1