Search Results

Search found 564 results on 23 pages for 'symfony 2 0'.

Page 1/23 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Extending existing Class in Symfony

    - by Dar Hamid
    I am new to symfony. I have created a registration form using the code: $user = new Register(); $form = $this->createForm(new RegisterType(), $user); In the RegisterType class i have 5 fields (for example).I store the values in database when the user registers with the system. Now I display the EDIT page using following code: $user = $em->getRepository('MysiteUserBundle:Register')->find($id); $form = $this->createForm(new RegisterType(), $user); The problem with the EDIT code however is that it displays me all of the fields mentioned in RegisterType class.Is it possible to display only some fields. If yes how can this be achieved. Any help will be appreciated

    Read the article

  • Symfony/Doctrine/SfGuardPlugin: Redirect to requested page (route), and not referrer

    - by Prasad
    I want to be able to take the user to the requested page after login, but this does not happen with sfGuard. ** My Register action requires SignIn ;) ** On the listing page [http://cim/frontend_dev.php/] - user clicks the 'Register' link [@register = register/index] - user is taken to 'Signin' page provided by sfGuard - after sign-in, user is taken back to the Listing page (instead of Register) This is quite annoying! But logical, because the referrer is the listing page. How can I change logic to make @register the referrer? Pl help. thanks public function executeSignin($request) { $user = $this->getUser(); $this->logMessage('Signin>>> form - isAuth() '.$user->isAuthenticated(), 'info'); if ($user->isAuthenticated()) { $this->getUser()->setAttribute('tenant', $this->getUser()->getGuardUser()->sfuser->Tenant->getID()); return $this->redirect($user->getReferer($request->getReferer())); } $class = sfConfig::get('app_sf_guard_plugin_signin_form', 'sfGuardFormSignin'); $this->form = new $class(); $referer = $user->getReferer($request->getReferer()); $this->logMessage('Signin>>> referer: '.$referer, 'info'); $this->logMessage('Signin>>> referer: '.$request->getReferer(), 'info'); if ($request->isMethod('post')) { $this->form->bind($request->getParameter('signin')); if ($this->form->isValid()) { $values = $this->form->getValues(); $this->getUser()->signin($values['user'], array_key_exists('remember', $values) ? $values['remember'] : false); $this->getUser()->setAttribute('tenant', $this->getUser()->getGuardUser()->sfuser->Tenant->getID()); $this->logMessage('Signin>>> sfUrl | @homepage: '.sfConfig::get('app_sf_guard_plugin_success_signin_url','@homepage'), 'info'); return $this->redirect("" != $referer ? $referer : sfConfig::get('app_sf_guard_plugin_success_signin_url','@homepage')); } } else { if ($request->isXmlHttpRequest()) { $this->getResponse()->setHeaderOnly(true); $this->getResponse()->setStatusCode(401); return sfView::NONE; } // if we have been forwarded, then the referer is the current URL // if not, this is the referer of the current request $user->setReferer($this->getContext()->getActionStack()->getSize() > 1 ? $request->getUri() : $request->getReferer()); $this->logMessage('Signin>>> oldy: '.$request->getUri(), 'info'); $this->logMessage('Signin>>> oldy: '.$request->getReferer(), 'info'); $module = sfConfig::get('sf_login_module'); if ($this->getModuleName() != $module) { return $this->redirect($module.'/'.sfConfig::get('sf_login_action')); } $this->getResponse()->setStatusCode(401); } } Trace: May 27 10:10:14 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/login) May 27 10:10:14 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/logout) May 27 10:10:14 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_password" (/request_password) May 27 10:10:14 symfony [info] {sfPatternRouting} Match route "register" (/register) for /register with parameters array ( 'module' => 'register', 'action' => 'index',) May 27 10:10:14 symfony [info] {sfFilterChain} Executing filter "sfGuardRememberMeFilter" May 27 10:10:14 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter" May 27 10:10:14 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter" May 27 10:10:14 symfony [info] {registerActions} Call "registerActions->executeIndex()" May 27 10:10:14 symfony [info] {sfFrontWebController} Redirect to "http://cim/frontend_dev.php/login" May 27 10:10:14 symfony [info] {sfWebResponse} Send status "HTTP/1.1 302 Found" May 27 10:10:14 symfony [info] {sfWebResponse} Send header "Location: http://cim/frontend_dev.php/login" May 27 10:10:14 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8" May 27 10:10:14 symfony [info] {sfWebDebugLogger} Configuration 13.39 ms (9) May 27 10:10:14 symfony [info] {sfWebDebugLogger} Factories 50.02 ms (1) May 27 10:10:14 symfony [info] {sfWebDebugLogger} Action "register/index" 1.94 ms (1) May 27 10:10:14 symfony [info] {sfWebResponse} Send content (104 o) May 27 10:10:16 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signin" (/login) May 27 10:10:16 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_signout" (/logout) May 27 10:10:16 symfony [info] {sfPatternRouting} Connect sfRoute "sf_guard_password" (/request_password) May 27 10:10:16 symfony [info] {sfPatternRouting} Match route "sf_guard_signin" (/login) for /login with parameters array ( 'module' => 'sfGuardAuth', 'action' => 'signin',) May 27 10:10:16 symfony [info] {sfFilterChain} Executing filter "sfGuardRememberMeFilter" May 27 10:10:16 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter" May 27 10:10:16 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter" May 27 10:10:16 symfony [info] {sfGuardAuthActions} Call "sfGuardAuthActions->executeSignin()" May 27 10:10:16 symfony [info] {sfGuardAuthActions} Signin>>> form - isAuth() May 27 10:10:16 symfony [info] {sfGuardAuthActions} Signin>>> referer: http://cim/frontend_dev.php/ May 27 10:10:16 symfony [info] {sfGuardAuthActions} Signin>>> referer: http://cim/frontend_dev.php/ May 27 10:10:16 symfony [info] {sfGuardAuthActions} Signin>>> oldy: http://cim/frontend_dev.php/login May 27 10:10:16 symfony [info] {sfGuardAuthActions} Signin>>> oldy: http://cim/frontend_dev.php/ May 27 10:10:16 symfony [info] {sfPHPView} Render "D:/projects/cim/plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/templates/signinSuccess.php" May 27 10:10:16 symfony [info] {sfPHPView} Decorate content with "D:\projects\cim\apps\frontend\templates/layout.php" May 27 10:10:16 symfony [info] {sfPHPView} Render "D:\projects\cim\apps\frontend\templates/layout.php" May 27 10:10:16 symfony [info] {main} Get slot "title" May 27 10:10:16 symfony [info] {sfWebResponse} Send status "HTTP/1.1 401 Unauthorized" May 27 10:10:16 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8" May 27 10:10:16 symfony [info] {sfWebDebugLogger} Configuration 16.06 ms (10) May 27 10:10:16 symfony [info] {sfWebDebugLogger} Factories 50.00 ms (1) May 27 10:10:16 symfony [info] {sfWebDebugLogger} Action "sfGuardAuth/signin" 14.53 ms (1) May 27 10:10:16 symfony [info] {sfWebDebugLogger} View "Success" for "sfGuardAuth/signin" 34.44 ms (1) May 27 10:10:16 symfony [info] {sfWebResponse} Send content (38057 o)

    Read the article

  • Can't get custom error rendering to work in symfony 1.4

    - by hongkildong
    I'm tring to customize error rendering in my form according to this example. Here is my code: if ($this['message']->hasError()) { $error_msg = '<ul>'; foreach ($this['message']->getError() as $error) $error_msg .= "<li>$error</li>"; $error_msg .= '</ul>'; } return $error_msg; but when $this['message'] has error this code returns '<ul></ul>' so it seems foreach ($this['message']->getError() as $error) causes no iterations $this['message']->getError() returns sfValidatorError object - maybe something changed in symfony 1.4 and it isn't iterable anymore... At first I thought that all magic in that example happened because of object being placed in $error by iteration implements __toString() but it seems no iterations happens at all...

    Read the article

  • Symfony - Several form on the same page -> ID issue

    - by Julien
    Hi folks. I have an issue while displaying several forms of the same model on the same page. The problem is that with the NameFormat, the fields have the same ID : $this->widgetSchema->setNameFormat('display[%s]'); Will display <form class="update_display_form" id="update_display_0" action="/iperf/web/frontend_dev.php/update_display" method="post"> <input type="checkbox" name="display[displayed]" checked="checked" id="display_displayed" /> <label for="display_displayed">test</label> </form> <form class="update_display_form" id="update_display_1" action="/iperf/web/frontend_dev.php/update_display" method="post"> <input type="checkbox" name="display[displayed]" checked="checked" id="display_displayed" /> <label for="display_displayed">truc</label> </form> And if you click on the second label, it will activate the first checkbox So I thought I could use the object id to make them unique : $this->widgetSchema->setNameFormat('display'.$this->getObject()->getId().'[%s]'); But then I can not process the request, since I don't know the name of the parameters. The best option I found was to set an ID : $this->widgetSchema['displayed']->setAttributes(array("id" => "display".$this->getObject()->getId() )); but then I totally loose the connections between the label and the checkbox. The problem would be solved if I could change the "for" attribute of my label. Does somebody know how to do that ? Or any other option ?

    Read the article

  • Ubuntu 13.10 Symfony installation date time issue

    - by Sambo
    I'm installing Symfony on my Ubuntu system, everything was going fine until the very last moment when I was met with a screen that said: ContextErrorException: Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/symfony-test/app/cache/dev/classes.php line 5107 in /var/www/symfony-test/app/cache/dev/classes.php line 5107 at ErrorHandler->handle('2', 'date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.', '/var/www/symfony-test/app/cache/dev/classes.php', '5107', array('level' => '100', 'message' => 'Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException".', 'context' => array())) at date_default_timezone_get() in /var/www/symfony-test/app/cache/dev/classes.php line 5107 at Logger->addRecord('100', 'Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException".', array()) in /var/www/symfony-test/app/cache/dev/classes.php line 5193 at Logger->debug('Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException".') in /var/www/symfony-test/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 246 at TraceableEventDispatcher->preListenerCall('kernel.exception', array(object(ProfilerListener), 'onKernelException')) in /var/www/symfony-test/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 448 at TraceableEventDispatcher->Symfony\Component\HttpKernel\Debug\{closure}(object(GetResponseForExceptionEvent)) at call_user_func(object(Closure), object(GetResponseForExceptionEvent)) in /var/www/symfony-test/app/cache/dev/classes.php line 1667 at EventDispatcher->doDispatch(array(object(Closure), object(Closure)), 'kernel.exception', object(GetResponseForExceptionEvent)) in /var/www/symfony-test/app/cache/dev/classes.php line 1600 at EventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in /var/www/symfony-test/app/cache/dev/classes.php line 1764 at ContainerAwareEventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in /var/www/symfony-test/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 139 at TraceableEventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in /var/www/symfony-test/app/bootstrap.php.cache line 2870 at HttpKernel->handleException(object(ContextErrorException), object(Request), '1') in /var/www/symfony-test/app/bootstrap.php.cache line 2823 at HttpKernel->handle(object(Request), '1', true) in /var/www/symfony-test/app/bootstrap.php.cache line 2947 at ContainerAwareHttpKernel->handle(object(Request), '1', true) in /var/www/symfony-test/app/bootstrap.php.cache line 2249 at Kernel->handle(object(Request)) in /var/www/symfony-test/web/app_dev.php line 28 After many hours of trying ideas in other threads, editing php.ini and classes.php to something that might work, I have gotten absolutely nowhere! Has anyone else had this problem

    Read the article

  • how to run existing symfony 1.4.18 project in localhost

    - by nickleefly
    I have all the symfony 1.4.18 source file in a folder called symfony. And I have the database. under this symfony folder it has apps, cache, config, data, lib, log, plugins, test, web, .gitignore, symfony what all i need to do to make it work in another shared host server? how can i make it run in localhost ? the config file is the following Under the config folder, vhost.conf file DocumentRoot /var/www/vhosts/example.com/httpdocs/web <Directory /var/www/vhosts/example.com/httpdocs/web> Options +FollowSymlinks php_admin_value open_basedir "/var/www/vhosts/example.com/httpdocs:/tmp:/usr/local/php:/usr/share/pear" </Directory> properties.ini file [prod] host=youripaddress port=22 user=yourusername dir=/var/www/vhosts/example.com/httpdocs/ type=rsync password=yourpassword databases.yml all: doctrine: class: sfDoctrineDatabase param: dsn: 'mysql:host=localhost;dbname=yourdbname' username: yourdbusername password: yourdbpassword attributes: default_table_type: InnoDB default_table_collate: utf8_unicode_ci default_table_charset: utf8 use_dql_callbacks: true

    Read the article

  • How to create a custom yaml config file in Symfony

    - by Guillaume Flandre
    What I want to do is quite simple: store data in a custom config file that I want to read later on. I created my file something.yml that I put in the global config directory. It looks like that: prod: test: ok dev: test: ko all: foo: bar john: doe Then I copied the config_handlers.yml and also put it in the config directory and added the following at the top of the file: config/something.yml: class: sfDefineEnvironmentConfigHandler param: prefix: something_ But if I'm calling sfConfig::get("something_foo"); I keep getting NULL. What did I do wrong? I just want to read values, so no need to create a custome config handler, right? I've read the doc here: http://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Configuration-Files even though I'm running 1.4 (I don't think that changed since then). Edit: Of course I can use sfYaml::load() but I'd like to do things in a better way.

    Read the article

  • how to compare between Doctrine & Propel in symfony

    - by Patrick
    I am in the early stages of rearchitecting my company's application. The app is currently running on symfony 1.2, and I used the default ORM at the time, Propel. Symfony has since updated to 1.4 and switched default ORM to Doctrine. From my understanding, each ORM excels at particular types of database structures. Is this true or is one far and away better than the other? Are there any good methods to test which ORM would be best in my situation in a test environment using my schema (i.e.- set up dual, identical sites and run tests)?

    Read the article

  • Symfony include_component() with components from a plugin

    - by Chris T
    All I'd like to do is use include_component to call a component from a plugin that I'm developing <?php #/plugins/fooPlugin/modules/barModule/actions/components.class.php class barModuleComponents extends sfComponents{ /** * Constructor */ function __construct(){ } function executeHello(){ } } ?> and <!-- /plugins/fooPlugin/modules/barModule/templates/_hello.php --> <p>HELLO WORLD!</p> But it won't load if I do this in #/apps/frontend/modules/homepage/templates/indexSuccess.php <?php include_component("barModule", "hello"); ?> XDebug gives me: ( ! ) Fatal error: Call to a member function add() on a non-object in C:\Program Files\WaterProof\PHPEdit\3.6.2\Extensions\Symfony\distribution\1.4\lib\helper\PartialHelper.php on line 360

    Read the article

  • Pass a variable to a Symfony Form

    - by Juan Besa
    Hi, I am building a web application using Symfony 1.4 and Doctrine for a school and I want to make a very simple form to add a course to a student. The main problem I have is that in the drop down list I only want to show the courses in which the student is currently not enrolled. I already have a function in the model (in Student.class.php) which returns all the courses in which the student is not enrolled but the problem is I don't know how to pass the student to the configure() of the form. I have tried several options like passing it with the constructor of the form to a global variable or a special set method but none of them have worked. Is there any form to pass the student to the configure() method? Thanks!

    Read the article

  • Render a partial from a task in Symfony 1.4

    - by Cryo
    I'm trying to render a partial in a Symfony task and having no luck. I found docs in 1.1 that say to just call get_partial() but apparently that's no longer readily available in 1.4. I tried loading the helper manually with sfLoader::getHelpers('Partial'); but I get "Class sfLoader not found". Any help would be greatly appreciated. For reference what I'm trying to do is generate an HTML file called 'header.html' from my global header partial used in all of my layouts for inclusion in a third-party forum I'm integrating (Simple Machines/SMF).

    Read the article

  • Fixtures and inheritance in Symfony

    - by Tere
    Hi! I have a database schema in Symfony like this: Persona: actAs: { Timestampable: ~ } columns: primer_nombre: { type: string(255), notnull: true } segundo_nombre: { type: string(255) } apellido: { type: string(255), notnull: true } rut: { type: string(255) } email: { type: string(255) } email2: { type: string(255) } direccion: { type: string(400) } ciudad: { type: string(255) } region: { type: string(255) } pais: { type: string(255) } telefono: { type: string(255) } telefono2: { type: string(255) } fecha_nacimiento: { type: date } Alumno: inheritance: type: concrete extends: Persona columns: comentario: { type: string(255) } estado_pago: { type: string(255) } Alumno_Beca: columns: persona_id: { type: integer, primary: true } beca_id: { type: integer, primary: true } relations: Alumno: { onDelete: CASCADE, local: persona_id, foreign: id } Beca: { onDelete: CASCADE, local: beca_id, foreign: id } Beca: columns: nombre: { type: string(255) } monto: { type: double } porcentaje: { type: double } descripcion: { type: string(5000) } As you see, "alumno" has a concrete inheritance from "persona". Now I'm trying to create fixtures for this two tables, and I can't make Doctrine to load them. It gives me this error: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (eat/alumno__beca, CONSTRAINT alumno__beca_persona_id_alumno_id FOREIGN KEY (persona_id) REFERENCES alumno (id) ON DELETE CASCADE) Does someone know how to write a fixture for a table inherited from another? Thanks!

    Read the article

  • Using Google Apps gmail with Symfony nahomail plugin

    - by bobo
    My boss asks me to update a domain to adopt Google Apps, now everything has been done except the website is still not updated to use the Google Apps gmail server. The website is running on Symfony 1.4.x but it is not the latest 1.4.x version, and it does not have Swiftmailer included. It now sends email (e.g. user registration confirm email) using the nahomail plugin. Now I would like to make it send email using the Google Apps gmail server. The website is going to be abandoned after a few months, for simplicity, I am going to do an update directly on the production server and so I am trying to avoid as many trial-and-errors as possible. I wonder if anyone is actually using this plugin and can share the nahomail settings for gmail server that has been working nicely. Many thanks to you all.

    Read the article

  • Logging from symfony's model layer

    - by naag
    I'm currently working on a project with symfony 1.4 and Doctrine 1.2. I'm looking for a proper way to do logging from the model layer. In some model classes I use the record hook postSave() to create a ZIP file using exec() (since PHP zip doesn't provide for storage method 'Stored'). To be sure that everythings works fine I check the return code and log an error if something goes wrong. My first naive approach was to do it like this: if ($returnCode != 0) { sfContext::getInstance()->getLogger()->debug(...); } As you know, this doesn't work so well because sfContext belongs to the controller layer and shouldn't be used from the model layer. My next try was to use the model's constructor to pass in an sfLogger instance, but this doesn't work due to Doctrine 1.2 reserving the constructor for internal use (Doctrine 1.2 Documentation). I'm looking forward for your suggestions!

    Read the article

  • symfony save submitted form to database

    - by Sejanus
    Maybe I am missing something, but in symfony examples, in form submission action there's nothing which indicates form data is saved to database. (link). How can I save everything to db? Example from the link: public function executeSubmit($request) { $this->forward404Unless($request->isMethod('post')); $params = array( 'name' => $request->getParameter('name'), 'email' => $request->getParameter('email'), 'message' => $request->getParameter('message'), ); $this->redirect('contact/thankyou?'.http_build_query($params)); }

    Read the article

  • Can Symfony simply reload a page request?

    - by Rob Wilkerson
    I have an app that receives a request from another app. It detects a value on the query string, checks that value against a cached value and, if they don't match, it needs to clear its cache and reload the page (establishing a new cache). Unfortunately, I can't find a way to tell Symfony to redirect to the current page in exactly the same format (protocol, URI path, query string, etc.). What am I missing? This is all happening in a filter on isFirstCall(). Thanks.

    Read the article

  • Adding classes to all form widgets in symfony

    - by rlahay
    Hi everyone, I am trying to find a better way to assign classes to form elements in symfony. Currently, I can't seem to get away from assigning each one manually. ie: $this->widgetSchema['title']->setAttribute("class","fieldInput"); $this->widgetSchema['tag_line']->setAttribute("class","fieldInput"); $this->widgetSchema['description']->setAttribute("class","fieldInput"); // etc Things I tried without success 1) looping through $this-widgetSchema, treating it as an array and setting attributes to each key 2) $this-widgetSchema-setAttribute() but this only applied the class to the label that was generated, not the form element There must be a way to hit all the fields without specifically directing them? Can anyone point me in the right direction?

    Read the article

  • Symfony 1.4 filter on index page

    - by Imran Azad
    I'm trying to apply a filter to the index page of my module, the code works as I've tested it on another page called filter within the same module. The problem I'm having is that on submitting the filter on the index page (form action points to index) Symfony instead decides to route to the create action for some reason. Although the create method isn't visible in the URL a new form is instantiated on the index page which leads me to suspect it is routing to the create action: http://locahost.com/frontend_dev.php/mymodule Any ideas how I can get a filter to work on the index page?

    Read the article

  • Symfony forms question (restoring selected value of a dynamically populated sfWidgetFormSelect widge

    - by Stick it to THE MAN
    I am using Symfony 1.3.2 with Propel ORM on Ubuntu 9.10. I have developed a form that dynamically populates a select widget with cities in a selected country, using AJAX. Before the data entered on the form is saved, I validate the form. If validation fails, the form is presented back to the user for correction. However, because the country list is dynamically generated, the form that is presented for correction does not have a valid city selected (it is empty, since the country widget has not changed yet). This is inconvenient for the user, because it means they have to select ANOTHER country (so the change event is fired), and then change back to the original country they selected, then FINALLY select the city which they had last selected. All of this is forced on the user because another (possibly unrelated) field did not vaildate. I tried $form-getValue('widget_name'), called immediately after $form-bind(), but it seems (infact, IIRC, if form fails to validate, all the values are reset to null) - so that does not work. I am currently trying a nasty hack which involves the use of directly accesing the input (i.e. tainted) data via $_POST, and setting them into a flash variable - but I feel its a very nasty hack) What I'm trying to do is a common use case scenario - is there a better way to do this, than hacking around with $_POST etc?

    Read the article

  • Symfony file upload - "Array" stored in database instead of the actual filename

    - by Guillaume Flandre
    I'm using Symfony 1.4.4 and Doctrine and I need to upload an image on the server. I've done that hundreds of times without any problem but this time something weird happens : instead of the filename being stored in the database, I find the string "Array". Here's what I'm doing: In my Form: $this->useFields(array('filename')); $this->embedI18n(sfConfig::get('app_cultures')); $this->widgetSchema['filename'] = new sfWidgetFormInputFileEditable(array( 'file_src' => '/uploads/flash/'.$this->getObject()->getFilename(), 'is_image' => true, 'edit_mode' => !$this->isNew(), 'template' => '<div id="">%file%</div><div id=""><h3 class="">change picture</h3>%input%</div>', )); $this->setValidator['filename'] = new sfValidatorFile(array( 'mime_types' => 'web_images', 'path' => sfConfig::get('sf_upload_dir').'/flash', )); In my action: public function executeIndex( sfWebRequest $request ) { $this->flashContents = $this->page->getFlashContents(); $flash = new FlashContent(); $this->flashForm = new FlashContentForm($flash); $this->processFlashContentForm($request, $this->flashForm); } protected function processFlashContentForm($request, $form) { if ( $form->isSubmitted( $request ) ) { $form->bind( $request->getParameter( $form->getName() ), $request->getFiles( $form->getName() ) ); if ( $form->isValid() ) { $form->save(); $this->getUser()->setFlash( 'notice', $form->isNew() ? 'Added.' : 'Updated.' ); $this->redirect( '@home' ); } } } Before binding my parameters, everything's fine, $request->getFiles($form->getName()) returns my files. But afterwards, $form->getValue('filename') returns the string "Array". Did it happen to any of you guys or do you see anything wrong with my code? Edit: I added the fact that I'm embedding another form, which may be the problem (see Form code above).

    Read the article

  • Character Set Issues when Upgrading from Symfony 2.0.* to Symfony 2.1.*?

    - by Adam Stacey
    I have recently upgraded my staging test site to the latest version of Symfony and updated all the vendors using composer as instructed in the upgrade document that comes with the download. Everything has all updated fine, but I have noticed now that some bits of HTML are not displaying in the Twig templates. I did a comparison with the current live site and it appears to be a character set issue. As an example I had a drop down list that had the following value in: Kitchen Ducting > Ducting Kits > Ducting Kit 4” / 100mm In the updated site the drop-down list item just appeared blank. When I used Twig's raw function it then displayed the item again, but with the dreaded question mark in a black diamond. Kitchen Ducting > Ducting Kits > Ducting Kit 4? / 100mm Things that you should know that may help: The staging test site and live site are both on the same server. In my httpd.conf file I have 'AddDefaultCharset utf-8'. In my php.ini file I have 'default_charset = "utf-8"'. The HTML file served has the Content-Type meta tag 'content="text/html; charset=utf-8"' My database is InnoDB and uses 'utf8' as the default character set and 'utf8_general_ci' as default collation. All tables in the database also use the defaults. I looked into BOM with UTF8, but could not work out if that was a problem or not?

    Read the article

  • sfJQueryUIPlugin: No Picker for new records

    - by Prasad
    Everyday is a new day with Symfony, but I'm loving it! This morning I installed the sfJQueryUIPlugin. It has very little dependencies & accepts themeRoller styles. However, it has 2 issues: [Feature_Request] There is no way to specify the year range. By default, it shows a 20 year range around the year in the field value. eg. if field value is 1993-01-20, the range will be 1983 to 2003. ??? Has anyone found a way out??? The DatePicker does not appear when the field is empty, Thus it does not show up during new record creation. To solve this, I tried setting up the default value in the date input field (which now appears as a text input) using $this->setDefault('date_of_birth',date('Y-m-d')); ??? Is anybody facing this problem of picker now available during new record creation ??? ??? Also is it the right way to set default value ??? Thanks in advance.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >