Search Results

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

Page 15/23 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Easy to use/learn PHP framework?

    - by Meredith
    I need to build a php app, and I was thinking about using a framework (never used one before). I've been browsing around some but most of them seems kinda complicated, I really liked what I saw about Symfony, but it looks like I will have to spend like a month until I really understand how to use it, and in one month I could code the app I have in mind 5 times without a framework. But I want to use one to "standardize" my code and prevent bugs. So I was wondering if someone could share with me which php frameworks you think are easier to learn how to use. My application will use mysql, and it will have some sort of "search engine" to search data that will be populated on the database using a few "scraper scripts" (that I also wants to code using the framework).

    Read the article

  • Symfony2 Syntax Errors (in vendor files)

    - by user1665246
    To maintain code integrity across our servers we'd like to keep the /vendor/* directory under source control, rather than use composer to download files each time we roll out onto another server - i.e. we can be certain that the /vendor/* files are identical. We run a syntax checker against all files committed to source control and run across the following error: File '/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php' failed the PHP syntax check with the following error: PHP Parse error: syntax error, unexpected '}', expecting T_NS_SEPARATOR in /vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php on line 3 Is the "error" in this file intentional ? Any help appreciated. File contents below: <?php namespace {{ namespace }}; use Symfony\Component\HttpKernel\Bundle\Bundle; class {{ bundle }} extends Bundle { }

    Read the article

  • sfConfig::get is not returning constants defined in app.yml

    - by morpheous
    I have an interesting problem. I am using Symfony 1.3.2. I have defined some constants in project/apps/frontend/config/app.yml and project/config/app.yml When I use the constant (correct spelling) in a piece of code like this $test=sfConfig::get('app_foobar'); the variable $test is assigned a null value. This is what I have checked so far: CHECK: cache files generated? (YES) CHECK: Do the cache files (config_app.yml.php) in the cache directory contain the constants defined in the app.yml file (YES) CHECK: Constant names used in the code matches the array keys found in config_app.yml? (YES) At this stage, I have run out of ideas. I dont want to supply a default value as a hack, because when I need to change the value of the constant, I will have to replace this in potentially hundreds of instances (too error prone). Is there anything that I have missed?. What could be causing this?

    Read the article

  • How should flushing be handled in a doctrine EntityManager instance shared across different services in symfony2?

    - by Jbm
    I have defined several services in symfony 2 which persist changes to the database. These services have the doctrine instance as one of their dependencies: a.given.service: class: Acme\TestBundle\Service\AGivenService arguments: [@doctrine] If I have two different services and both of them persist objects through the EntityManager, which is obtained like this from the doctrine instance: $em = $doctrine->getEntityManager(); Would all services always share the same EntityManager? If so, how should I handle flushing if I wanted to handle all the changes in a single transaction? I have checked this: http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/transactions-and-concurrency.html and it explains how to handle different transactions in a request, but I want to achieve the opposite, which is having different changes in different services handled as a single transaction. Is there a better approach to handle multiple changes in different services? For now my best bet is having a front-end service in charge of calling the other services and doing the flushing afterwards. Backend services would persist objects but would not do any flushing.

    Read the article

  • What is the most efficient approach to fetch category tree, products, brands, counts by subcategory

    - by alex227
    Symfony 1.4 + Doctrine 1.2. What is the best way to minimize the number of queries to retrieve products, subcategories of current category, product counts by subcategory and brand for the result set of the query below? Categories are a nested set. Here is my query: $q = Doctrine_Query::create() ->select('c.*, p.product,p.price, b.brand') ->from('Category c') ->leftJoin('c.Product p') ->leftJoin('p.Brand b') ->where ('c.root_id = ?', $this->category->getRootId()) ->andWhere('c.lft >= ?', $this->category->getLft()) ->andWhere('c.rgt <= ?', $this->category->getRgt()) ->setHydrationMode(Doctrine_Core::HYDRATE_ARRAY); $treeObject = Doctrine::getTable('Category')->getTree(); $treeObject->setBaseQuery($q); $this->treeObject = $treeObject; $treeObject->resetBaseQuery(); $this->products = $q->execute();

    Read the article

  • Password Hash Implementation

    - by oyerli
    I am developing a new application using Symfony. I want to store the passwords hashed, so I overridded the save method in my User model: public function save(Doctrine_Connection $conn = null) { $this->setUserPassword( md5($this->getUserPassword()) ); return parent::save($conn); } This works good when a new user created. However, this causes problems when we edit a user without changing his password. This causes Doctrine to hash the already hashed password. So, I need to check that whether the UserPassword is modified in this DoctrineRecord instance. How can I manage to do that?

    Read the article

  • database structure for threads that are editable by many users?

    - by fayer
    at the moment i have a column "user_id" in the "threads" table cause one thread belongs to an user. i want to make it like Stackoverflow that one thread can be editable by many users and you can see when they edited, what they edited, roll back changes and so on. im using symfony, is there a plugin for this? if no, are there any 3rd part libraries/plugins to download for this to integrate to existing database? cause i have no idea how to implement this. it sounds like mediawiki, something that already exists? thanks

    Read the article

  • PHP : Symfony sort en version 2.1 définitive, gestion des dépendances avec Composer, formulaires plus efficaces et Mailer plus performant

    Symfony2 est un projet très communautaire, depuis le début (des centaines de bundles étaient disponibles bien avant les premières RC de la 2.0), une tendance qui se confirme : 250 contributeurs, 1 000 pull requests sur GitHub pour la première version beta de Symfony 2.1 ! Après les difficultés de migration avec symfony 1.x, l'équipe a tenté autant que possible de restreindre les changements à même de casser la rétrocompatibilité ; de même, le refactoring du module de formulaires a fait que la version finale de la 2.1 devrait sortir en août, afin de concentrer autant que possible les changements et faire que de plus en plus de code ne devra pas être modifié lors de la migration d'une version à l'autre. Ainsi, n'hésitez pas à tenter de migrer vos applications vers cette beta,...

    Read the article

  • PHP : Symfony sort en version 2.1 définitive, gestion des dépendances avec Composer, formulaires et Mailer plus performants

    Symfony2 est un projet très communautaire, depuis le début (des centaines de bundles étaient disponibles bien avant les premières RC de la 2.0), une tendance qui se confirme : 250 contributeurs, 1 000 pull requests sur GitHub pour la première version beta de Symfony 2.1 ! Après les difficultés de migration avec symfony 1.x, l'équipe a tenté autant que possible de restreindre les changements à même de casser la rétrocompatibilité ; de même, le refactoring du module de formulaires a fait que la version finale de la 2.1 devrait sortir en août, afin de concentrer autant que possible les changements et faire que de plus en plus de code ne devra pas être modifié lors de la migration d'une version à l'autre. Ainsi, n'hésitez pas à tenter de migrer vos applications vers cette beta,...

    Read the article

  • Sortie de la première beta de Symfony 2.1, Composer, chargement automatique des classes et adoption des règles de codage de la communauté

    Symfony2 est un projet très communautaire, depuis le début (des centaines de bundles étaient disponibles bien avant les premières RC de la 2.0), une tendance qui se confirme : 250 contributeurs, 1 000 pull requests sur GitHub pour la première version beta de Symfony 2.1 ! Après les difficultés de migration avec symfony 1.x, l'équipe a tenté autant que possible de restreindre les changements à même de casser la rétrocompatibilité ; de même, le refactoring du module de formulaires a fait que la version finale de la 2.1 devrait sortir en août, afin de concentrer autant que possible les changements et faire que de plus en plus de code ne devra pas être modifié lors de la migration d'une version à l'autre. Ainsi, n'hésitez pas à tenter de migrer vos applications vers cette beta,...

    Read the article

  • Warning: Memcache::connect(0memcache.connect0): Can't connect to localhost:11211, Connection refuse

    - by Stick it to THE MAN
    I am using Symfony 1.3.2 with Propel ORM on Ubuntu 9.10. I am incorporating memcache to the website. I have modified the setup() method in apps/frontend/ProjectConfiguration.class.php like this: class ProjectConfiguration { public function setup() { // original SF generated code here .. require_one sfConfig::get('sf_lib_dir').'/MyCache.class.php'; myCache::init(); } } my cache singleton is implemented something like this: class MyCache { private static memcache = null; private static inited = false; public static init() { if (self::$inited) return; self::$memcache = new Memcache(); if (self::$memcache->connect('localhost', 11211) { // Do some stuff .. self::$inited = true; } } } Warning: Memcache::connect(0memcache.connect0): Can't connect to localhost:11211, Connection refused(111) in /path_to_class/MyCache.class.php This happens for both CLI (e.g. running SF tasks) or for web access through the browser. Does anyone know how to resolve this (I suspect its something to do with Linux user privileges). As an aside, I am aware that SF prvoides an sfAPCache wrapper class for cacheing. I am intentionally not using it for two reasons: I cannot find any comprehensive (and up to date) docs on this class I want to learn the memcache API directly, since I will be accesing it from other languages.

    Read the article

  • Cloud-aware programming and help choosing a good framework

    - by Shoaibi
    How can i write a cloud-aware application? e.g. an application that takes benefit of being deployed on cloud. Is it same as an application that runs or a vps/dedicated server? if not then what are the differences? are there any design changes? What are the procedures that i need to take if i am to migrate an application to cloud-aware? Also i am about to implement a web application idea which would need features like security, performance, caching, and more importantly free. I have been comparing some frameworks and found that django has least RAM/CPU usage and works great in prefork+threaded mode, but i have also read that django based sites stop to respond with huge load of connections. Other frameworks that i have seen/know are Zend, CakePHP, Lithium/Cake3, CodeIgnitor, Symfony, Ruby on Rails.... So i would leave this to your opinion as well, suggest me a good free framework based on my needs. Finally thanks for reading the essay ;)

    Read the article

  • What framework would allow for the largest coverage of freelance developers in the media/digital mar

    - by optician
    This question is not about which is the best, it is about which makes the most business sense to use as a company's platform of choice for ongoing freelance development. I'm currently trying to decide what framework to move my company in regarding frameworks for web application work. Options are ASP.NET MVC Django CakePHP/Symfony etc.. Struts Pearl on Rails Please feel free to add more to the discussion. I currently work in ASP.NET MVC in my Spare time, and find it incredibly enjoyable to work with. It is my first experince with an MVC framework for the web, so I can't talk on the others. The reason for not pushing this at the company is that I feel that there are not many developers in the Media/Marketing world who would work with this, so it may be hard to extend the team, or at least cost more. I would like to move into learning and pushing Django, partly to learn python, partly to feel a bit cooler (all my geeky friends use Java/Python/c++). Microsoft is the dark side to most company's I work with (Marketing/Media focused). But again I'm worried about developers in this sector. PHP seems like the natural choice, but I'm scared by the sheer amount of possible frameworks, and also that the quality of developer may be lower. I know there are great php developers out there, but how many of them know multiple frameworks? Are they similar enough that anyone decent at php can pick them up? Just put struts in the list as an option, but personally I live with a Java developer, and considering my experience with c#, I'm just not that interested in learning Java (selfish personal geeky reasons) Final option was a joke http://www.bbc.co.uk/blogs/radiolabs/2007/11/perl_on_rails.shtml

    Read the article

  • Doctrine 1.2: How do i prevent a contraint from being assigned to both sides of a One-to-many relati

    - by prodigitalson
    Is there a way to prevent Doctrine from assigning a contraint on both sides of a one-to-one relationship? Ive tried moving the definition from one side to the other and using owning side but it still places a constraint on both tables. when I only want the parent table to have a constraint - ie. its possible for the parent to not have an associated child. For example iwant the following sql schema essentially: CREATE TABLE `parent_table` ( `child_id` varchar(50) NOT NULL, `id` integer UNSIGNED NOT NULL auto_increment, PRIMARY KEY (`id`) ); CREATE TABLE `child_table` ( `id` integer UNSIGNED NOT NULL auto_increment, `child_id` varchar(50) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY (`child_id`), CONSTRAINT `parent_table_child_id_FK_child_table_child_id` FOREIGN KEY (`child_id`) REFERENCES `parent_table` (`child_id`) ); However im getting something like this: CREATE TABLE `parent_table` ( `child_id` varchar(50) NOT NULL, `id` integer UNSIGNED NOT NULL auto_increment, PRIMARY KEY (`id`), CONSTRAINT `child_table_child_id_FK_parent_table_child_id` FOREIGN KEY (`child_id`) REFERENCES `child_table` (`child_id`) ); CREATE TABLE `child_table` ( `id` integer UNSIGNED NOT NULL auto_increment, `child_id` varchar(50) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY (`child_id`), CONSTRAINT `parent_table_child_id_FK_child_table_child_id` FOREIGN KEY (`child_id`) REFERENCES `parent_table` (`child_id`) ); I could just remove the constraint manually or modify my accessors to return/set a single entity in the collection (using a one-to-many) but it seems like there should built in way to handle this. Also im using Symfony 1.4.4 (pear installtion ATM) - in case its an sfDoctrinePlugin issue and not necessarily Doctrine itself.

    Read the article

  • Loader.php trying to load Doctrine classes, but we use Propel!

    - by kewpiedoll99
    We are finding cases where we get the following 500 error: File xyz.php does not exist or class "xyz" was not found in the file at () in SF_ROOT_DIR/lib/vendor/Zend/Loader.php line 107 ... where xyz == Memcache (when trying to use symfony cc on the command line) or sfDoctrineAdminGenerator (when using an old-ish AdminGenerator-generated CMS page). We use Propel, but Loader.php is trying to load classes used only for Doctrine. Currently I am using a filthy hack where I request Loader.php to check if the file is either of these two cases, and if so simply return rather than trying to load it. Obviously, this is unacceptable longer term. Has anybody encountered this, and how did you solve it? Edited to add: We have: class ProjectConfiguration extends sfProjectConfiguration { public function setup() { // for compatibility / remove and enable only the plugins you want $this->enableAllPluginsExcept(array('sfDoctrinePlugin')); } } And we have a propel.ini file in our top level config directory. This has only started in the past four weeks or so, and we've had a stable build for over a year now. I'm pretty sure Doctrine is totally disabled.

    Read the article

  • php paging class

    - by Stick it to THE MAN
    Can anyone recommend a good PHP paging class? I have searched google, but have not seen anything that matches my requirements. Rather than "rolling my own" (and almost surely reinventing the wheel), I decided to check in here first. First some background: I am developing a website using Symfony 1.3.2 with Propel ORM on Ubuntu 9.10. I am currently using the Propel pager, which is OK, but I recently started using memcache to speed things up a little. At this point, the Propel pager is of little use, as it (AFAIK), only works with Propel objects. What I need is a class th:t meets the following requirents Has clean interface, with separation of concerns, so that the logic to retrieve records from the datasource (e.g. database) is encapsulated in a class (or at least a separate file). Can work with arrays of objects Provides pagination links, and only fetches the data required for the current page. Also, the pagination should 'split' the available page links if there are too many. For example, if there are potentially 1000 possible page links, the pages displayed should be something like FIRST 2,3 ....999 LAST Can return the number of all the records in the table being queried, so that the following links are available FIRST, LAST (this requirement is actually already covered in the previous requirement - but I just wanted to re-emphasise it). Can anyone recommend such a library, if they have used it succesfully in the past? Alternatively, someobe may have 'hacked' (e.g. derived from) the current Propel pager, to get it to do the things I listed about - please let me know.

    Read the article

  • Corrupt UTF-8 Characters with PHP 5.2.10 and MySQL 5.0.81

    - by jkndrkn
    We have an application hosted on both a local development server and a live site. We are experiencing UTF-8 corruption issues and are looking to figure out how to resolve them. The system is run using symfony 1.0 with Propel. On our development server, we are running PHP 5.2.0 and MySQL 5.0.32. We do not experience corrupted UTF-8 characters there. On our live site, PHP 5.2.10 and MySQL 5.0.81 is running. On that server, certain characters such as ô´ and S are corrupted once they are stored in the database. The corrupted characters are showing up as either question marks or approximations of the original character with adjacent question marks. Examples of corruption: Uncorrupted: ô´ Corrupted: ô? Uncorrupted: S Corrupted: ? We are currently using the following techniques on both development and live servers: Executing the following queries prior to execution of any other queries: SET NAMES 'utf8' COLLATE 'utf8_unicode_ci' SET CHARSET 'utf8' Setting the <meta> Content-Type value to: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Adding the following to our .htaccess file: AddDefaultCharset utf-8 Using mb_* (multibyte) PHP functions where necessary. Being sure to set database columns to use utf8_unicode_ci collation. These techniques are sufficient for our development site, but do not work on the live site. On the live site I've also tried adding mysql_set_encoding('ut8', $mysql_connection) but this does not help either. I have found some evidence that newer versions of PHP and MySQL are mishandling UTF-8 character encodings.

    Read the article

  • Research and replace Word Rtf

    - by Perello
    I'm working on an application which has a workflow for postal mails. These postal mails are generated according to my application business rules. Models are in html or Rtf and it works perfectly as long the user do not create the rtf with word. This is not within the specs, but my hierarchy would welcome a Word compatibility if it don't involve too much work, and it would please and ease the life of our customer. The Rtf models have tags which are replaced by application values. In most RTF, tags are not splitted, so the search and replace works perfectly. I wish to be handle word with few modifications. Example data : [[FooBuzz]] in most rtf it's not splited. In word 2003 : {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid5517131 [[}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2708730 FooBuzz}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid5517131 ]]} And their word (word 2007) splitted also Foo{garbage inside} Buzz. So i wish to be able to handle common RTF perfectly, and detect tags even if they are splitted. I have 2 constraints. First no regression, second it has to stay simple. Performance is not an issue here. I'm using symfony 1.4. The actual relevant research code part : $regExpression = '/\[\[([^\[\]]*)\]\]/'; preg_match_all($regExpression, $sTemplate, $outKeys);

    Read the article

  • 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

  • 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

  • FOSUserBundle override mapping to remove need for username

    - by musoNic80
    I want to remove the need for a username in the FOSUserBundle. My users will login using an email address only and I've added real name fields as part of the user entity. I realised that I needed to redo the entire mapping as described here. I think I've done it correctly but when I try to submit the registration form I get the error: "Only field names mapped by Doctrine can be validated for uniqueness." The strange thing is that I haven't tried to assert a unique constraint to anything in the user entity. Here is my full user entity file: <?php // src/MyApp/UserBundle/Entity/User.php namespace MyApp\UserBundle\Entity; use FOS\UserBundle\Model\User as BaseUser; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity * @ORM\Table(name="depbook_user") */ class User extends BaseUser { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\Column(type="string", length=255) * * @Assert\NotBlank(message="Please enter your first name.", groups={"Registration", "Profile"}) * @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"}) */ protected $firstName; /** * @ORM\Column(type="string", length=255) * * @Assert\NotBlank(message="Please enter your last name.", groups={"Registration", "Profile"}) * @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"}) */ protected $lastName; /** * @ORM\Column(type="string", length=255) * * @Assert\NotBlank(message="Please enter your email address.", groups={"Registration", "Profile"}) * @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"}) * @Assert\Email(groups={"Registration"}) */ protected $email; /** * @ORM\Column(type="string", length=255, name="email_canonical", unique=true) */ protected $emailCanonical; /** * @ORM\Column(type="boolean") */ protected $enabled; /** * @ORM\Column(type="string") */ protected $salt; /** * @ORM\Column(type="string") */ protected $password; /** * @ORM\Column(type="datetime", nullable=true, name="last_login") */ protected $lastLogin; /** * @ORM\Column(type="boolean") */ protected $locked; /** * @ORM\Column(type="boolean") */ protected $expired; /** * @ORM\Column(type="datetime", nullable=true, name="expires_at") */ protected $expiresAt; /** * @ORM\Column(type="string", nullable=true, name="confirmation_token") */ protected $confirmationToken; /** * @ORM\Column(type="datetime", nullable=true, name="password_requested_at") */ protected $passwordRequestedAt; /** * @ORM\Column(type="array") */ protected $roles; /** * @ORM\Column(type="boolean", name="credentials_expired") */ protected $credentialsExpired; /** * @ORM\Column(type="datetime", nullable=true, name="credentials_expired_at") */ protected $credentialsExpiredAt; public function __construct() { parent::__construct(); // your own logic } /** * @return string */ public function getFirstName() { return $this->firstName; } /** * @return string */ public function getLastName() { return $this->lastName; } /** * Sets the first name. * * @param string $firstname * * @return User */ public function setFirstName($firstname) { $this->firstName = $firstname; return $this; } /** * Sets the last name. * * @param string $lastname * * @return User */ public function setLastName($lastname) { $this->lastName = $lastname; return $this; } } I've seen various suggestions about this but none of the suggestions seem to work for me. The FOSUserBundle docs are very sparse about what must be a very common request.

    Read the article

  • Adding interactions to admin pages generated by the admin generator

    - by Stick it to THE MAN
    I am using Symfony 1.2.9 (with Propel ORM) to create a website. I have started using the admin generator to implement the admin functionality. I have come accross a slight 'problem' however. My models are related (e.g. one table may have several 1:N relations and N:N relations). I have not found a way to address this satisfactorily yet. As a tactical solution (for list views), I have decided to simply show the parent object, and then add interactions to show the related objects. I'll use a Blog model to illustrate this. Here are the relationships for a blog model: N:M relationship with Blogroll (models a blog roll) 1:N relationship with Blogpost (models a post submitted to a blog) I had originally intended on displaying the (paged) blogpost list for a blog,, when it was selected, using AJAX, but I am struggling enough with the admin generator as it is, so I have shelved that idea - unless someone is kind enough to shed some light on how to do this. Instead, what I am now doing (as a tactical/interim soln), is I have added interactions to the list view which allow a user to: View a list of the blog roll for the blog on that row View a list of the posts for the blog on that row Add a post for the blog on tha row In all of the above, I have written actions that will basically forward the request to the approriate action (admin generated). However, I need to pass some parameters (like the blog id etc), so that the correct blog roll or blog post list etc is returned. I am sure there is a better way of doing what I want to do, but in case there isn't here are my questions: How may I obtain the object that relates to a specific row (of the clicked link) in the list view (e.g. the blog object in this example) Once I have the object, I may choose to extract various fields: id etc. How can I pass these arguments to the admin generated action ? Regarding the second question, my guess is that this may be the way to do it (I may be wrong) public function executeMyAddedBlogRollInteractionLink(sfWebRequest $request) { // get the object *somehow* (I'm guessing this may work) $object = $this->getRoute()->getObject(); // retrieve the required parameters from the object, and build a query string $query_str=$object->getId(); //forward the request to the generated code (action to display blogroll list in this case) $this->forward('backendmodulename',"getblogrolllistaction?params=$query_string"); } This feels like a bit of a hack, but I'm not sure how else to go about it. I'm also not to keen on sending params (which may include user_id etc via a GET, even a POST is not that much safer, since it is fairly sraightforward to see what requests a browser is making). if there is a better way than what I suggest above to implement this kind of administration that is required for objects with 1 or more M:N relationships, I will be very glad to hear the "recommended" way of going about it. I remember reading about marking certain actions as internal. i.e. callable from only within the app. I wonder if that would be useful in this instance?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >