[symfony-users] Force an Autocompletion list pick for input_auto_complete_tag
Hi Everyone ! Don't you know if there is a mean to force user selecting an autocomplete list choice when using input_auto_complete_tag ? I would like the input_auto_complete_tag to be kinda read-only : the user could only select something in the autocomplete list, but would not be able to type something in the input_tag which is not in the autocomplete list. Thanks in advance, that would be really helpful. PS: Some of you may ask : Hey ?! You're looking for a select_tag ! But ... no ! With a select tag I can't dynamically update options to select easily. Then ... try using a select tag with z-indexed stacked divs on browser = IE6 ... you'll quickly want something else too. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Joining and Hydrating Propel Objects
One of my tables has about 10 foreign keys. Now I need Propel to select the table values joining and hydrating with respect to 2 foreign keys. I know for 1 key I can be done with doSelectJoinXXX, but what if I want to join 2 tables ?? I can't even use doSelectJoinAllExceptXXX cause that would try to hydrate about 9 objects which I don't want. Please help... Manoj Ghimire --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Joining and Hydrating Propel Objects
You have to - create a criteria object - join the table you want - use YourFirstTablePeer::addSelectColumns($c) and YourSecondTablePeer::addSelectColumns($c) - $rs = YourFirstTablePeer::doSelectRs($c) - hydrate your objects : while($rs-next()) { $firstObject = new $pos = $firstObject-hydrate($rs); $secondObject = new ... $secondObject-hydrate($rs, $pos) $firstObject-add($secondObject) } you may want to handle a pool of objects with an array if the same $firstObject appears several times. Thomas On Mon, Jun 23, 2008 at 12:11 PM, Manoj Ghimire [EMAIL PROTECTED] wrote: One of my tables has about 10 foreign keys. Now I need Propel to select the table values joining and hydrating with respect to 2 foreign keys. I know for 1 key I can be done with doSelectJoinXXX, but what if I want to join 2 tables ?? I can't even use doSelectJoinAllExceptXXX cause that would try to hydrate about 9 objects which I don't want. Please help... Manoj Ghimire -- Thomas Rabaix Internet Consultant --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Generating url for a route with param containing slashes
Hi, I'm trying to get the url of a route with a param containing slashes like @mypage?slug=foo/bar. The genUrl() methode of sfWebController encode the param and return : /mypage/foo%2Fbar rather than /mypage/foo/bar. I found a very bad solution in using a PLACEHOLDER in place of the param value and replacing it after the generation. Another bad pratice is to urldecode the returned url :( Any better idea ? Best regards, -- Nicolas CHARLOT http://www.isics.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Generating url for a route with param containing slashes
The only solution I've found is to Base64 encode the URL - you get the same problem with the sfExternalLinkTracker plugin. Base64 encoding the URL seems to solve most of these problems. On 23 Jun 2008, at 13:19, Nicolas CHARLOT wrote: Hi, I'm trying to get the url of a route with a param containing slashes like @mypage?slug=foo/bar. The genUrl() methode of sfWebController encode the param and return : /mypage/foo%2Fbar rather than /mypage/foo/bar. I found a very bad solution in using a PLACEHOLDER in place of the param value and replacing it after the generation. Another bad pratice is to urldecode the returned url :( Any better idea ? Best regards, -- Nicolas CHARLOT http://www.isics.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: creating object from another one
That is good info, thanks for sharing. I always have created_at columns, so I assumed you can always save empty object.. now I'm actually preferring the no saving of empty objects approach :) Thanks again, and have a great day. Daniel On Jun 22, 9:59 pm, simo [EMAIL PROTECTED] wrote: Hi Richtermeister well, I did overwrite nothing actually . I only had a __toString() method to my Provider class. But finally, I understood. It was working well adding a sluugableBehavior on the Provider item and not working without it. That's why I thought it was related to the plugin. Since I didn't supply any information to the Provider object, there was nothing to insert (it seems to be the default behavior of symfony). For others objects I have not supplied anything either but I have 'created_at' and 'updated_at' fields which triggered the SQL actions in the DB. Hope It can help. Many thanks, Richtermeister! On Jun 22, 10:28 pm, Richtermeister [EMAIL PROTECTED] wrote: Hi Simo, not sure what's happening there. It's certainly not the out-of-the-box behavior of propel objects, so I suspect you have some customization that messes with the default behavior.. For example, did you overwrite the constructor in the Provider? Or the save method? Daniel On Jun 22, 10:01 am, simo [EMAIL PROTECTED] wrote: I'm using the sfPropelActAsSluggableBehaviorPlugin and I guess the problem could come from it. DId anyone had a similar problem using it? On Jun 22, 1:23 pm, simo [EMAIL PROTECTED] wrote: I checked objects structures : The main difference is that the Provider Object get the '_new' attribute set to 1. Why it gets the value set to 1? Do you think it can explain the problem? On Jun 22, 1:00 pm, simo [EMAIL PROTECTED] wrote: Hi everybody, When I create an object i'm initializing 3 dependents objects. In /lib/model/myItem.php, I overload the save method(): ANd I initialize my objetcs that way : // Initializing dependent objects // object already known as new Indicator - no test $assessment = new Assessment(); $assessment-save(); $this-setAssessment($assessment); $guideline = new Guideline(); $guideline-save(); $this-setGuideline($guideline); $provider = new Provider(); $provider-save(); $this-setProvider($provider); Both Assessment and Guideline objects are created but not my Provider Object! With no mention of errors. I had a look on my log. Of course, there is no trace of the SQL INSERT request for providers . When I'm creating a Provider object through myapp/provider/create, everything is working well. Do I process a wrong way? Any idea of the problem? Many thanks, simo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] sfLucene and words highlighting
I installed sfLucene plugin and when I use it an exception is thrown by sfLucenHilighter.class.php : throw new sfLuceneHighlighterException('Highlighting failed because content is malformed X/HTML'); Acctually my code is not XHTML... so I want to desactivate syntax highlighting in sfLucen results page but I don't see that parameter on the online doc ... Any ideas ? Thanks ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Force an Autocompletion list pick for input_auto_complete_tag
Hi Shinkan, that sounds like a chicken egg problem, where you can't disable the field completely, since the user would never be able to trigger it.. I guess you would need to watch userinput on this field, and on every keystroke ensure that you only allow letters that make sense with what is in the select fields. If the users strikes a letter that is not valid, you can remove it.. (Obviously this should only apply after the initial list of options is loaded). Let me know if this is interesting to you and I can help with the JS code as well, Daniel On Jun 23, 1:03 am, Shinkan [EMAIL PROTECTED] wrote: Hi Everyone ! Don't you know if there is a mean to force user selecting an autocomplete list choice when using input_auto_complete_tag ? I would like the input_auto_complete_tag to be kinda read-only : the user could only select something in the autocomplete list, but would not be able to type something in the input_tag which is not in the autocomplete list. Thanks in advance, that would be really helpful. PS: Some of you may ask : Hey ?! You're looking for a select_tag ! But ... no ! With a select tag I can't dynamically update options to select easily. Then ... try using a select tag with z-indexed stacked divs on browser = IE6 ... you'll quickly want something else too. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Force an Autocompletion list pick for input_auto_complete_tag
Hi Daniel, Thanks for your quick and consciencious answer. I don't want to overload client-side treatments with an each-letter- triggered call. Above all, this would be a relatively heavy treatment as you would have to access the autocomplete list, then search in it for cohesions. I thought there would be a one parameter set way of doing that, as I often see it on some websites. But once again, thanks for your suggestion. On 23 juin, 16:17, Richtermeister [EMAIL PROTECTED] wrote: Hi Shinkan, that sounds like a chicken egg problem, where you can't disable the field completely, since the user would never be able to trigger it.. I guess you would need to watch userinput on this field, and on every keystroke ensure that you only allow letters that make sense with what is in the select fields. If the users strikes a letter that is not valid, you can remove it.. (Obviously this should only apply after the initial list of options is loaded). Let me know if this is interesting to you and I can help with the JS code as well, Daniel On Jun 23, 1:03 am, Shinkan [EMAIL PROTECTED] wrote: Hi Everyone ! Don't you know if there is a mean to force user selecting an autocomplete list choice when using input_auto_complete_tag ? I would like the input_auto_complete_tag to be kinda read-only : the user could only select something in the autocomplete list, but would not be able to type something in the input_tag which is not in the autocomplete list. Thanks in advance, that would be really helpful. PS: Some of you may ask : Hey ?! You're looking for a select_tag ! But ... no ! With a select tag I can't dynamically update options to select easily. Then ... try using a select tag with z-indexed stacked divs on browser = IE6 ... you'll quickly want something else too. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Generating url for a route with param containing slashes
Le 23 juin 08 à 15:10, Lee Bolding a écrit : The only solution I've found is to Base64 encode the URL U mean after generation ? -- Nicolas CHARLOT http://www.isics.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Generating url for a route with param containing slashes
how about: function link_to_path($text, $uri, $options = array()) { $link = link_to($text, $uri, $options); return str_replace('%2F', '/', $link); } Still kinda hackish, but since you can't selectively deactivate URL parameter encoding in symfony... Cheers, François 2008/6/23 Nicolas CHARLOT [EMAIL PROTECTED]: Hi, I'm trying to get the url of a route with a param containing slashes like @mypage?slug=foo/bar. The genUrl() methode of sfWebController encode the param and return : /mypage/foo%2Fbar rather than /mypage/foo/bar. I found a very bad solution in using a PLACEHOLDER in place of the param value and replacing it after the generation. Another bad pratice is to urldecode the returned url :( Any better idea ? Best regards, -- Nicolas CHARLOT http://www.isics.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Symfony Form Framework: sfForm ArrayAccess
Hi Everybody, Today I was creating a form with the new form framework, which is really a joy once you're past understanding its approach :-D It left me to wonder if it would be a nice addition if sfForm implemented the arrayitterator interface so you could loop over form fields to create the templates... [example] ?php foreach ($form as $formField): ? div class='form_field' div class='bar_small_txt' ?php echo $formField-renderLabel(), \n; ? /div ?php if ($formField-hasError()): ? div class='errors' ?php echo $formField-renderError(), \n; ? /div ?php endif; ? ?php echo $formField-render(array('class' = 'pretty')), \n; ? /div ?php endforeach; ? [/example] I think this allows for easily decoration of the different fields AND nice small template files. I haven't played around a lot with the new Form Framework so maybe I'm overlooking something.. Marijn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] sfGuard, securing and Templates
Good morning everyone Just want a few pointers on how to do the following. 1) Add a link to the sfGuard login on an application template 2) Secure selected modules of an application based upon user group 3) Allow main module to be accessible to everyone All assistance would be appreciated. Adrian --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: sfGuard, securing and Templates
Hi Adrian, 1 ) Try something like: ?php echo link_to(__(login), @sf_guard_signin) ? of if you want a more aware link: ?php echo ($sf_user-isAuthenticated()) ? link_to(__(logout), @sf_guard_signout): link_to(__(login), @sf_guard_signin); ? 2 ) Try not to think of it in terms of authenticating a group. It all relates back to a single permission/credential. So the groups Blog_Editor and Content_Editor might both have the permission/credential Can_Delete_Files - and it's that part you're actually checking. So in your modules security.yml you might have something like: delete: is_secure: on credentials: [Can_Delete_Files] all: is_secure: on credentials: [Is_A_Special_User] 3 ) By default, a module should be open/public. Even if sfGuard is installed. But if you need to explicitly turn security off: is_secure: off That should do the trick :) - Piers On 24/06/2008, at 11:16 AM, Gould, Adrian wrote: Good morning everyone Just want a few pointers on how to do the following. 1) Add a link to the sfGuard login on an application template 2) Secure selected modules of an application based upon user group 3) Allow main module to be accessible to everyone All assistance would be appreciated. Adrian --- Adrian Gould Lecturer in IT / Network Engineering / Multimedia Business Finance Computing [Midland Campus] Swan TAFE PO BOX 1336, Midland WA 6936 Phone: (08) 9267 eMail: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Multiple applications sharing one set of assets
Thanks for the suggestion -- I don't think that will work in my particular case, but it reminds me that I have other options than just adding on to the routing system itself. For instance, I could use a filter to fix some of these problems. Not ideal, but at least it would keep the problematic code confined to one place where it could be removed easily if a better solution presents itself. On Tue, Jun 17, 2008 at 5:50 PM, Charles Hilditch [EMAIL PROTECTED] wrote: Not sure if this will help you too much but I ran into a problem with relative_url_root as well. I'm dealing with a large existing legacy site (just static html generated from a large corporate CMS) It's a bit complicated to explain but I used symfony to insert content into these existing html files on the fly, in effect each requested file becomes the 'layout.php' and all subsequent requests use that page as the layout, this works for my purposes, just simple forms. Since the relative path to each html file may be different I gave up on the settings.yml relative_url_root, it just didn't work, so I ended up hacking the $_SERVER variable in the controller. It's a bit ugly (URLs produced with the likes of url_for() look like this - '/aaa/bbb/index.htm?route=/module/action') but this suited my needs. (Symfony 1.0.14) define('SF_ROOT_DIR',realpath(dirname(__FILE__).'/xxx')); define('SF_APP', 'xxx'); define('SF_ENVIRONMENT', 'dev'); define('SF_DEBUG', true); require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); // $_SERVER hack $url = parse_url($_SERVER['REQUEST_URI']); $_SERVER['PATH_INFO'] = isset($_REQUEST['route']) ? $_REQUEST['route'] : $url['path']; $_SERVER['SCRIPT_NAME'] = preg_replace('/\.php/','.htm',$_SERVER['SCRIPT_NAME']); // needed, because legacy html files use .htm extension, not .php // This will make symfony prepend the current url and append the 'route' param to all outbound links, forms etc. sfContext::getInstance()-getRequest()-setRelativeUrlRoot( $url['path'] . '?route=' ); // URL helpers work as expected ie. link_to, url_for, form_tag 2008/6/18 David Brewer [EMAIL PROTECTED]: Almost all of the symfony projects I create follow the same basic kind of model: * one database + one set of image assets associated with items in the database * an application called srv which presents this content as a REST web service. This application resides in a subdirectory, http://example.com/srv * an application called admin for admin tools. This application resides in a subdirectory, http://example.com/admin * an application called site where the frontend of the site resides. This application is at the root, http://example.com For a while I've been struggling with an issue without finding a satisfactory workaround, and I'm hoping that someone here has a good solution. The problem is the automated url generation when in an application which resides in a subdirectory. Let's say you're in the srv application. Then, depending on the value you have set for sf_relative_url_root in settings.yml, you have one of two bad choices: * If you have sf_relative_url_root set to '', your links to shared assets work properly. But, any links generated using the url helpers don't include the prefix to your site, so instead of a link being http://example.com/srv/resource, you instead get http://example.com/resource. * If you have sf_relative_url_root set to '/srv', your links to shared assets such as css and images are broken as they include the '/srv' prefix even if you have defined them as absolute paths like '/css/styles.css'. This is essentially the same issue as described in this ticket: http://trac.symfony-project.com/ticket/2543. Has anyone come up with an acceptable way of dealing with this issue? So far the best I've been able to to is put in hacky relative paths for certain assets, such as '../../css/styles.css' to get to the stylesheet I want. David Brewer -- Charles Hilditch Web Developer [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---