Search Results

Search found 6564 results on 263 pages for 'symfony forms'.

Page 37/263 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • convert date error when retrieving data in twig page through doctrine

    - by user201892
    I just find this error when I retrieve all my records on twig page from the database through doctrine here is my twig code : {% extends "gestionConferenceApplicationBundle::layout.html.twig" %} {% block title "Hello " ~ name %} {% block content %} je suis un debutant <table border=2 > <th>Numéro</th> <th>Titre</th> <th>Ville</th> <th>Lieu</th> <th>Date de début</th> <th>Date de fin</th> {% for item in conferences %} <tr> <td>{{ item.id }}</td> <td>{{ item.titre }}</td> <td>{{ item.ville }}</td> <td>{{ item.lieu }}</td>* <td>{{ item.dateDebut }}</td> <td>{{ item.dateFin }}</td> </tr> {% endfor %} </table> {% endblock %} the error in the date : here it is : An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Object of class DateTime could not be converted to string in C:\wamp\www\Symfony\app\cache\dev\twig\3c\dd\40a703549de9b8769fa40b82230e.php line 72") in gestionConferenceApplicationBundle:acceuil:acceuil.html.twig at line 19. do you have any idea how to convert this date or any other things in the MySql I have dateTime field and in doctrine I have : /** * @var \DateTime $dateDebut * * @ORM\Column(name="date_debut", type="datetime", nullable=false) */ private $dateDebut;

    Read the article

  • [Concept] How does unlink() find the file to delete?

    - by Prasad
    My app has a 'Photo' field to store URL. It uses sfWidgetFormInputFileEditable for the widget schema. To delete the old image when a new image is uploaded, I use unlink before setting the value in the over-ridden setter and it works!!! if (file_exists($this->_get('photo'))) unlink($this->_get('photo')); Photos are stored in uploads/photos and when saving 'Photo' only the file name xxx-yyy.zzz is saved (and not the full path). However, I wish to know how symfony/php knows the full path of the file to be deleted? Part 2: I am using sfThumbnailPlugin to generate thumbnails. So the actual code looks like this: public function setPhoto($value) { if(!empty($value)) { Contact::generateThumbnail($value); // delete current Photo & create thumbnail $this->_set('photo',$value); // setting new value after deleting old one } } public function generateThumbnail($value) { $uploadDir = sfConfig::get('app_photo_upload'); // path to upload folder if (file_exists($this->_get('photo'))) { unlink($this->_get('photo')); // delete full-size image // path to thumbnail $thumbpath = $uploadDir.'/thumbnails/'.$this->get('photo'); // read a blog, tried setting dir manually, doesn't work :( //chdir('/thumbnails/'); // tried closing the file too, doesn't work! :( //fclose($thumbpath) or die("can't close file"); //unlink($this->_get('photo')); // doesn't work; no error :( unlink($thumbpath); // doesn't work, no error :( } $thumbnail = new sfThumbnail(150, 150); $thumbnail->loadFile($uploadDir.'/'.$value); $thumbnail->save($uploadDir.'/thumbnails/'.$value, 'image/png'); } Why can't the thumbnail be deleted using unlink()? is the sequence of ops incorrect? Is it because the old thumbnail is displayed in the sfWidgetFormInputFileEditable widget? I've spent hours trying to figure this out, but unable to nail down the real cause. Thanks in advance.

    Read the article

  • PHP session corrupt

    - by Baversjo
    Using symfony framework 1.4 I have created a website. I'm using sfguard for authentication. Now, this is working great on WAMP (windows). I can login to several accounts on different browsers and use the website. I have ubuntu server 9.10 running apache (everything up to date and default configuration). On my server, when I login to the website in one browser it works great. When I on my other computer login with another user account on the public website, the login is successful. But when I refresh/go to another page the first user is shown as logged in instead! Also, when I press logout, It's not showing that I'm logged out after page load. When I press f5 again I'm logged out. As mentioned, all this works as expected on my local installation. I'm thinking there something wrong with my PHP session configuration on my ubuntu server, but I've never touched it.. Please help me. This is a school project and I'm presenting it today :(

    Read the article

  • Oracle Enterprise Manager Logs

    - by idea_
    Hi, I'm attempting to investigate the root cause of the following error which occurs each time a users call an Oracle 10g Forms applet: FRM-92102: A network error has occurred. The Forms Client has attempted to reestablish its connection to the Server 1 time(s) without success. Please check the network connection and try again later. Details... Java Exception: java.io.IOException: Connection failure with 503 This error remained after restarting all my system components: HTTP_Server, OC4J_BI_Forms, Web Cache, Reports Server, etc. The only way to clear this issue was to restart the server entirely. During the downtime, web pages were rendered with the PL/SQL cartridge and being served, so it appears as though this was isolated to forms. Does anybody know which log files may provide clues here? Any help would be much appreciated :) Update: If somebody can provide me with a way or reference to increase the capacity of my web server to minimize these errors, I will accept this as the solution.

    Read the article

  • Is it me or is developing web based data entry GUIs a big pain?

    - by GregH
    Maybe it's me or maybe it isn't. I don't have a huge amount of experience of developing web based data entry software but do have some. I used to do it quite a bit years ago. Used to use Oracle Forms, Visual Studio, various 4th generation languages, and performing the user interface layout used to be a snap. Now doing the user interface for developing web applications seems to be a huge pain in the rear. Just trying to get text entry fields and widgets to go where they are supposed to go on the screen is a total pain. You have to know Javascript, CSS, JQuery, HTML, etc. There must be an easier way to develop data entry forms that produce the needed underlying code for a web page. Maybe I'm just not looking in the right place. There must be some WYSIWYG GUI development tools for the web for developing data entry forms out there. Anybody know of any?

    Read the article

  • AuthenticationForm - cookie cross site

    - by bit
    I've 2 web site, the first one myFirst.domain.com and the second one mySecondSite.domain.com. They stay on two different web server and my goal is allow a cross site authentication (my real need is shared authenticationForm Cookie). I've correctly setted web config (machine key node, forms node). The only different is about loginUrl where on myFirstSite appears like "~/login.aspx", instead on mySecondSite it appears like "http://myFirstSite.com/login.aspx". Note that I've not a virtual directory, I've just 2 different web apps. The problem: When I reach myFirstSite login page from mySecondSite I never get redirect from login page, it seems like if cookie doesn't being written. The following is a few of snippet about the issue: MyFirsSite: <machineKey validationKey="..." decryptionKey="..." validation="SHA1" decryption="AES" /> <authentication mode="Forms"> <forms loginUrl="login.aspx" name="authCookie" enableCrossAppRedirects="true"></forms> </authentication> <authorization> <deny users="?" /> <allow users="*"/> </authorization> MyFirstSite code behind: FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1, "userName..", DateTime.Now, DateTime.Now.AddMinutes(30), true, "roles.."); string ticket = FormsAuthentication.Encrypt(fat); HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, ticket); authCookie.Expires = fat.Expiration; authCookie.Domain = "myDomain.com"; Response.Cookies.Add(authCookie); // here other stuff about querystring checking in order to execute exact redirect, however it's not work, I always return on login page MySecondSite: <machineKey validationKey="..." decryptionKey="..." validation="SHA1" decryption="AES"/> <authentication mode="Forms"> <forms loginUrl="http://myFirstSite.domain.com/login.aspx?queryStringToIndicateUrlPage" enableCrossAppRedirects="true"></forms> </authentication> <authorization> Well, that's all. Unfortunately it doesn't works. please, don't pay attention to "queryStringToIndicateUrlPage", it's only simple workaround in order to know whether I must redirect on the same app or on the another one.

    Read the article

  • Injecting the mailer service, got "The service definition 'mailer' does not exist"?

    - by Gremo
    This is the class where the service mailer should be injected: namespace Gremo\SkebbyBundle\Transport; use Swift_Mailer; use Gremo\SkebbyBundle\Message\AbstractSkebbyMessage; class MailerTransport extends AbstractSkebbyTransport { /** * @var \Swift_Mailer */ private $mailer; public function __construct(Swift_Mailer $mailer) { $this->mailer = $mailer; } /** * @param \Gremo\SkebbyBundle\Message\AbstractSkebbyMessage $message * @return void */ public function executeTransport(AbstractSkebbyMessage $message) { /* ... */ } } Service id is gremo_skebby.transport.mailer, placed inside mailer.xml file: <parameters> <parameter key="gremo_skebby.converter.swift_message.class"> Gremo\SkebbyBundle\Converter\SwiftMessageConverter </parameter> <parameter key="gremo_skebby.transport.mailer.class"> Gremo\SkebbyBundle\Transport\MailerTransport </parameter> </parameters> <services> <service id="gremo_skebby.converter.swift_message" class="%gremo_skebby.converter.swift_message.class%" public="false" /> <service id="gremo_skebby.transport.mailer" class="%gremo_skebby.transport.mailer.class%" public="false" parent="gremo_skebby.tranport.abstract_transport"> <argument type="service" id="mailer" /> </service> </services> When i try to inject the gremo_skebby.transport.mailer into another service (an helper) i get: Symfony\Component\DependencyInjection\Exception\InvalidArgumentException : The service definition "mailer" does not exist. That is strange, because command php app/console container:debug shows that the mailer service actually exists: mailer container Swift_Mailer I'm loading mailer.xml file dynamically by the extension: if(in_array($configs['transport'], array('http', 'rest', 'mailer'))) { $loader->load('transport.xml'); $loader->load($configs['transport'] . '.xml'); $container->setAlias('gremo_skebby.transport', 'gremo_skebby.transport.' . $configs['transport']); } $loader->load('skebby.xml'); ... and gremo_skebby.transport service is injected into gremo_skebby.skebby service (skebby.xml): <parameters> <parameter key="gremo_skebby.skebby.class"> Gremo\SkebbyBundle\Skebby </parameter> </parameters> <services> <service id="gremo_skebby.skebby" class="%gremo_skebby.skebby.class%"> <argument type="service" id="gremo_skebby.transport" /> </service> </services> A quick test is giving me the same InvalidArgumentException: public function testSkebbyWithMailerTransport() { $loader = new GremoSkebbyExtension(); $container = new ContainerBuilder(); $config = $this->getEmptyConfiguration(); $loader->load(array($config), $container); $this->assertTrue($container->hasDefinition('gremo_skebby.transport.mailer')); $this->assertTrue($container->hasDefinition('gremo_skebby.skebby')); $this->assertInstanceOf('Gremo\SkebbyBundle\Skebby', $container->get('gremo_skebby.skebby')); }

    Read the article

  • Parallelism in .NET – Part 17, Think Continuations, not Callbacks

    - by Reed
    In traditional asynchronous programming, we’d often use a callback to handle notification of a background task’s completion.  The Task class in the Task Parallel Library introduces a cleaner alternative to the traditional callback: continuation tasks. Asynchronous programming methods typically required callback functions.  For example, MSDN’s Asynchronous Delegates Programming Sample shows a class that factorizes a number.  The original method in the example has the following signature: public static bool Factorize(int number, ref int primefactor1, ref int primefactor2) { //... .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } However, calling this is quite “tricky”, even if we modernize the sample to use lambda expressions via C# 3.0.  Normally, we could call this method like so: int primeFactor1 = 0; int primeFactor2 = 0; bool answer = Factorize(10298312, ref primeFactor1, ref primeFactor2); Console.WriteLine("{0}/{1} [Succeeded {2}]", primeFactor1, primeFactor2, answer); If we want to make this operation run in the background, and report to the console via a callback, things get tricker.  First, we need a delegate definition: public delegate bool AsyncFactorCaller( int number, ref int primefactor1, ref int primefactor2); Then we need to use BeginInvoke to run this method asynchronously: int primeFactor1 = 0; int primeFactor2 = 0; AsyncFactorCaller caller = new AsyncFactorCaller(Factorize); caller.BeginInvoke(10298312, ref primeFactor1, ref primeFactor2, result => { int factor1 = 0; int factor2 = 0; bool answer = caller.EndInvoke(ref factor1, ref factor2, result); Console.WriteLine("{0}/{1} [Succeeded {2}]", factor1, factor2, answer); }, null); This works, but is quite difficult to understand from a conceptual standpoint.  To combat this, the framework added the Event-based Asynchronous Pattern, but it isn’t much easier to understand or author. Using .NET 4’s new Task<T> class and a continuation, we can dramatically simplify the implementation of the above code, as well as make it much more understandable.  We do this via the Task.ContinueWith method.  This method will schedule a new Task upon completion of the original task, and provide the original Task (including its Result if it’s a Task<T>) as an argument.  Using Task, we can eliminate the delegate, and rewrite this code like so: var background = Task.Factory.StartNew( () => { int primeFactor1 = 0; int primeFactor2 = 0; bool result = Factorize(10298312, ref primeFactor1, ref primeFactor2); return new { Result = result, Factor1 = primeFactor1, Factor2 = primeFactor2 }; }); background.ContinueWith(task => Console.WriteLine("{0}/{1} [Succeeded {2}]", task.Result.Factor1, task.Result.Factor2, task.Result.Result)); This is much simpler to understand, in my opinion.  Here, we’re explicitly asking to start a new task, then continue the task with a resulting task.  In our case, our method used ref parameters (this was from the MSDN Sample), so there is a little bit of extra boiler plate involved, but the code is at least easy to understand. That being said, this isn’t dramatically shorter when compared with our C# 3 port of the MSDN code above.  However, if we were to extend our requirements a bit, we can start to see more advantages to the Task based approach.  For example, supposed we need to report the results in a user interface control instead of reporting it to the Console.  This would be a common operation, but now, we have to think about marshaling our calls back to the user interface.  This is probably going to require calling Control.Invoke or Dispatcher.Invoke within our callback, forcing us to specify a delegate within the delegate.  The maintainability and ease of understanding drops.  However, just as a standard Task can be created with a TaskScheduler that uses the UI synchronization context, so too can we continue a task with a specific context.  There are Task.ContinueWith method overloads which allow you to provide a TaskScheduler.  This means you can schedule the continuation to run on the UI thread, by simply doing: Task.Factory.StartNew( () => { int primeFactor1 = 0; int primeFactor2 = 0; bool result = Factorize(10298312, ref primeFactor1, ref primeFactor2); return new { Result = result, Factor1 = primeFactor1, Factor2 = primeFactor2 }; }).ContinueWith(task => textBox1.Text = string.Format("{0}/{1} [Succeeded {2}]", task.Result.Factor1, task.Result.Factor2, task.Result.Result), TaskScheduler.FromCurrentSynchronizationContext()); This is far more understandable than the alternative.  By using Task.ContinueWith in conjunction with TaskScheduler.FromCurrentSynchronizationContext(), we get a simple way to push any work onto a background thread, and update the user interface on the proper UI thread.  This technique works with Windows Presentation Foundation as well as Windows Forms, with no change in methodology.

    Read the article

  • Threading.Timer vs. Forms.Timer

    - by Jekke
    The short form of this question: When, if ever, is it appropriate to use the Forms.Timer in a multithreaded WinForms application? More specifically, I am architecting an application that uses multiple System.Threading.Timers to launch processes asynchronously, check queues containing the results of those asynchronous processes, and update the statistics to be shown by the application's main form. In an application like that, is it appropriate to use a Forms.Timer to actually check the application statistics and draw them to the main form or would that just throw a wrench into the application's smooth running?

    Read the article

  • ASP.NET web forms as ASP.NET MVC

    - by lopkiju
    I am sorry for possible misleading about the title, but I have no idea for a proper title. Feel free to edit. Anyway, I am using ASP.NET Web Forms, and maybe this isn't how web forms is intended to be used, but I like to construct and populate HTML elements manually. It gives me more control. I don't use DataBinding and that kind of stuff. I use SqlConnection, SqlCommand and SqlDataReader, set SQL string etc. and read the data from the DataReader. Old school if you like. :) I do create WebControls so that I don't have to copy-paste every time I need some control, but mostly, I need WebControls to render as HTML so I can append that HTML into some other function that renders the final output with the control inside. I know I can render a control with control.RenderControl(writer), but this can only be done in (pre)Render or RenderContents overrides. For example. I have a dal.cs file where is stored all static functions and voids that communicate with the database. Functions mostly return string so that it can be appended into some other function to render the final result. The reason I am doing like this is that I want to separate the coding from the HTML as much as I can so that I don't do <% while (dataReader.Read()) % in HTML and display the data. I moved this into a CodeBehind. I also use this functions to render in the HttpHandler for AJAX response. That works perfectly, but when I want to add a control (ASP.NET Server control (.cs extension, not .ascx)) I don't know how to do that, so I see my self writing the same control as function that returns string or another function inside that control that returns string and replaces a job that would RenderContents do, so that I can call that function when I need control to be appended into a another string. I know this may not be a very good practice. As I see all the tutorials/videos about the ASP.NET MVC, I think it suite my needs as with the MVC you have to construct everything (or most of it) by your self, which I am already doing right now with web forms. After this long intro, I want to ask how can I build my controls so I can use them as I mentioned (return string) or I have to forget about server controls and build the controls as functions and used them that way? Is that even possible with ASP.NET Server Controls (.cs extension) or am I right when I said that I am not using it right. To be clear, I am talking about how to properly use a web forms, but to avoid data binders because I want to construct everything by my self (render HTML in Code Behind). Someone might think that I am appending strings like "some " + "string", which I am not. I am using StringBuilder for that so there's no slowness. Every opinion is welcome.

    Read the article

  • Integrating MarkitUp and MarkdownSharp with asp.net forms website

    - by N00b
    Hi, I'm using markdownsharp with my asp.net forms website. I want to use MarkItUp as my editor and have found a straight forward article on how to integrate with MVC which seems straight forward enough: http://rsolberg.com/2010/09/asp-net-mvc-markitup-rich-text-editor/ However, how do I do this with a forms website? How do I get the MarkItDown Textarea on a postback and get the preview to work as well?

    Read the article

  • how to use two forms and sumit once

    - by Mac Taylor
    hey guys is it possible to have two forms with two submit buttons but when i click on the button then it saves both forms input fields im concerning to solve this in php /mysql i tried my own way : if ((isset($_POST["form-1"])) && (isset($_POST["form-2"])) { //SQL Insertion } thanks in advance

    Read the article

  • Display both forms together

    - by Ani
    I have 2 forms Form1 and Form2, when program executes I want both forms to display but Form2 with ShowDialog(); i.e user has to respond to Form2 before using Form1. How can I achieve this? Form2 will take userinput and will display on Form1, so do I have to hide Form2 after user responds to Form2 or just kill it.

    Read the article

  • One click to trigger several search forms?

    - by Christian
    Hello, I have 1 main search form with a submit button and several secondary search forms with submit buttons. What I would like to do is when I enter text and click on the submit button of the main search form, the same text gets copied in all of the secondary search forms and all the submit buttons of the secondary search forms get automatically hit. The HTML code for the mains earch form is shown below: <form action="query.php" method="get"> Search: <input type="text" name="item" size="30"> <input type="submit" value="send"> </form> One of the several secondary search forms is shown below: <FORM action="http://www.dpbolvw.net/interactive" method="GET" target="_blank"> <div style="float: left; padding: 0 3px 0 0;"> <INPUT type="text" name="src" size="9" value="<?php $input = $_GET['item']; echo $input;?>" style="width: 110px; height: 22px;margin:0; padding: 0; font-size:140%;"> </div> <div style="float: left; padding: 0 3px 0 0;"> <input type="image" name="submit" value="GO" src="http://images.guitarcenter.com/Content/GC/banner/go.gif" alt="Search" style="font-size:140%"> /div> <input type="hidden" name="aid" value="1234"/> <input type="hidden" name="pid" value="1234"/> <input type="hidden" name="url" value="http://www.guitarcenter.com/Search/Default.aspx"/> </form> Notice the php code that I put in the "value" field of the secondary search form: <?php $input = $_GET['item']; echo $input;?> This automatically copies the text that I entered in the main search form into the secondary search form. I thus figured out how to do that. The problem is to "simulate" an "Enter" keystroke or a click on the "GO" button with the mouse on the secondary search form when the user hits the Enter key or hits the "SEND" button with the mouse on the main search form. Thank you for your insight!

    Read the article

  • WPF or Windows Forms

    - by Luminose
    I've been playing around with C# console applications for about a year and I want to move on to creating GUI applications. I have never done any GUI development besides basic Java applications, but I want to continue using C#. Should I start learning Windows Forms or jump straight to WPF? Is there a huge difference? Does WPF build on top of Windows Forms or are they totally different?

    Read the article

  • modal forms and shared data,

    - by Tumble
    I've written a couple of c# forms applications which use a lot of the same data/objects which would better be combined. I realise I could use modal forms to launch each of these but where should I state .dll's and other resources, on the parent form? or on each other form where necessary?

    Read the article

  • RoR - Associations into practise - forms (View)

    - by NicoJuicy
    I'm learning Ruby on Rails. I'm using some associations (has_many :through, ...) But i'm having some problems with it when i'm combining my views. How exactly do i combine these nested forms? Can i do this with partial forms and where do i have to write extra code for this? I have seen examples only use the "view" and others also edit the controller.... An example would be very nice :-)

    Read the article

  • Rails HTML editor to create forms

    - by Ignace
    Hey all, I'm looking for a HTML editor which can be (easiliy) integrated in a RoR app that has the possibility to create forms. Not forms per se, but I need the possibility to add radiobuttons, input fields, checkboxes and so on. I loved the smoothness of TinyMCE, but apparently this doesn't take me far enough. Does there exists such a gem/plugin? Thanks!

    Read the article

  • How to make nested child forms in C#.net

    - by abu
    In my windows form application I am using 10 forms.It is fine when only a parent and single child form are used at a time. But in case of multiple use of child form I am getting problem and not able to use them as child forms.They are not working as child form. Your any effort would be helpful for me. Thanking You In Advance

    Read the article

  • How to style forms in the Zend framework?

    - by user505988
    Hi, I really like the idea of putting forms into a seperate class that manages validation etc, but I don't like everything ending up in a DL and also not being able to use square bracket notation in post elements like <input type='checkbox' name='data[]'>. Is there another way of generating forms - like in views so I can style them the way I want, but also keeping the validation aspect? Also how would I load this view into my current view (using partial view somehow?)

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >