我正在使用Symfony 1.2.9进行项目,我需要使用AJAX来进行文件uplaod.我还没有找到办法做到这一点 - 尽管谷歌搜索几天.
我使用JQuery和原型作为我的javascript框架.
任何人都可以在Symfony中提供如何使用AJAX上传文件的示例吗?
我有这个代码:
$this->lista_miembros = $this->filtro->buildQuery($valores_query);
var_dump($this->lista_miembros);
Run Code Online (Sandbox Code Playgroud)
var_dump输出一个Doctrine_Query对象:
object(Doctrine_Query)[121]
protected'_subqueryAliases'=> array
我试过getSql()......
$q = Doctrine_Query::create()
->select('u.id')
->from('User u')
->whereIn('u.id', array(1, 3, 4, 5));
echo $q->getSql();
Run Code Online (Sandbox Code Playgroud)
..但我没有那个getSql()函数!
那么我怎样才能获得该Doctrine_Query对象的SQL子句?
哈维
我有一个典型的封面页面,其登录表单没有包含网站实习页面的菜单栏的布局.
所以我在view.yml中有这一行:
signinSuccess:
has_layout: false
Run Code Online (Sandbox Code Playgroud)
如您所知,这样就不会加载.css了.那么我该怎么做才能加载.css?
问候
哈维
我在我的项目中安装了sfTCPDFPlugin,但是当我尝试测试安装是否正常时(在官方网站上找到了源代码),我收到错误:
Fatal error: Class 'TCPDF' not found in C:\wamp\www\mairie\plugins\sfTCPDFPlugin\lib\sfTCPDF.class.php on line 12
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
我最近部署了一个Symfony 1.3.6网站.我已选择在服务器上保留frontend_dev.php,因此我可以在绝对需要时在本地计算机上进行调试.
我像这样修改了frontend_dev.php:
<?php
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true);
// this check prevents access to debug front controllers that are deployed by accident to production servers.
// feel free to remove this, extend it or make something more sophisticated.
if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
{
//in case something screwy happens ...
try
{
// die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
sfContext::createInstance($configuration)->getController()->forward('security', 'error404');
exit();
}
catch(Exception $e)
{
//if we got here, all bets …Run Code Online (Sandbox Code Playgroud) 我是使用Symfony的新手,在最近几个月尝试了CodeIgniter和CakePHP之后我终于解决了这个问题.
我对Web框架有足够的专业知识,但对Symfony框架完全不了解.
现在我在这里有点混乱,因为Symfony 2.0 beta就在这里.
我只是想知道我应该开始学习Symfony 2.0 beta或Symfony 1.4,考虑到未来的期望.Symfony有一个艰难的学习曲线因此,我不想在以后再次通过它.
小部件看起来像这样:
$this->widgetSchema['tara'] = new sfWidgetFormChoice(array(
'choices' => Doctrine_Core::getTable('Users')->getCountry(),
'expanded' => false,
'multiple' => false,
));
Run Code Online (Sandbox Code Playgroud)
和getCountry函数:
static public $country = array(
'1' => 'România',
'2' => 'United States',
'3' => 'France',
);
public function getCountry()
{
return self::$country;
}
Run Code Online (Sandbox Code Playgroud)
现在小部件呈现如下:
但我希望它看起来像这样:
我怎样才能做到这一点?
我的这个symfony Recepciones类与Obras_Sociales_Recepciones类有关,因为我的BaseRecepciones类声称:
/* @method Recepciones setRecepcionId() Sets the current record's "recepcion_id" value
* @method Recepciones setCuentaLaboratorioId() Sets the current record's "cuenta_laboratorio_id" value
* @method Recepciones setCuentasLaboratorios() Sets the current record's "Cuentas_Laboratorios" value
* @method Recepciones setObrasSocialesRecepciones() Sets the current record's "Obras_Sociales_Recepciones" collection
*/
abstract class BaseRecepciones extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('Recepciones');
$this->hasColumn('recepcion_id', 'integer', 4, array(
'type' => 'integer',
'fixed' => 0,
'unsigned' => true,
'primary' => true,
'autoincrement' => true,
'length' => 4,
));
$this->hasColumn('cuenta_laboratorio_id', 'integer', 4, …Run Code Online (Sandbox Code Playgroud) 我在这里有一个问题.我有一个在symfony 1.0上运行的网站.我使用symfony admin生成器工具生成一个界面来编辑数据库中的信息.在编辑页面上,我有一些文本字段需要将整数值保存在数据库中.我遇到的问题是,如果我没有在需要整数并且命中SAVE的文本字段中放置任何内容,则ZERO的值将保存在数据库中(而不是null).请记住,在数据库的结构中,保存整数的列的类型是INT(11)DEFAULT NULL.因此,通常,如果我不输入任何内容,应该保存NULL.
知道什么可能出错吗?
我想在symfony(版本1.4.8)中执行一个cron.
我试图通过命令使用任务:php symfony generate:task taskName.
通过它生成的任务存储在lib/task目录中,它可以访问我所有的外部'lib'文件.我还想要我的其他lib文件夹,即应用程序中存在的库也可以在此任务中访问.我怎样才能做到这一点?
我们什么时候将$namespace任务设置为"项目"和"应用程序"?