我有一台Profile模型
<?php
class Model_Profile extends Model_Table {
public $table = 'profile';
function init(){
parent::init();
...
$m = $this->add('filestore/Field_Image');
}
}现在,在我的index.php中,我尝试在模板中设置完整的图像路径。
$m = $this->add('Model_Profile')->loadBy('user_id',$this->api->auth->get('id'));
//Here i want to var_dump the full image path example (/admin/upload/0/20131123014011__photo-on-23-11-2013-at-01.36.jpg)这将向我显示表filestore_file中的图像id。
die('Filestore image:' . $m->get('filestore_field_image'));与此主题相关的讨论:https://groups.google.com/forum/#!topic/agile-toolkit-devel/i-i9OK4Ya1A
我试过了
$fm = $this->add('filestore/Field_Image')->load($m->get('filestore_field_image'));
var_dump($fm->getThumbURLExpr());但是它抛出了一个异常
其他链接:
FileStore step by step example with 4.2.1
发布于 2013-11-23 10:51:41
我想出来了,是这样的:
$m = $this->add('Model_Profile')->loadBy('user_id',$this->api->auth->get('id'));
$mf = $this->add('filestore/Model_File');
$mf->load($m->get('filestore_field_image'));
var_dump($mf->get('url'));https://stackoverflow.com/questions/20157698
复制相似问题