This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Today's Messages (OFF)  | Unanswered Messages (ON)

Forum: Feature requests
 Topic: function such as hierselect of QuickForm
function such as hierselect of QuickForm [message #7345] Mon, 12 June 2006 10:16
dotlain  is currently offline dotlain
Messages: 1
Registered: June 2006
Junior Member
Hi,
I expect a function such as hierselect of QuickForm.
 Topic: [PATCH] Themes don't allow new templates.
[PATCH] Themes don't allow new templates. [message #7360] Mon, 12 June 2006 22:04
dizm  is currently offline dizm
Messages: 1
Registered: June 2006
Junior Member
This patch upgrades the sfPropelAdminGenerator class to process all php files in the theme's template directory instead of a hard coded list. This is useful, for example, if you want to have a seperate createSuccess.php for your theme.

 Topic: sfThumbnail
sfThumbnail [message #7580] Sun, 18 June 2006 11:30
Gimler  is currently offline Gimler
Messages: 83
Registered: March 2006
Location: Germany
Member

can you implement this to the sfThumbnail plugin?

Now you can set an explicit heigh or width.

Change line 262:
if ($this->sourceWidth > $this->sourceHeight)

to
if (($this->sourceWidth > $this->sourceHeight AND $this->maxWidth !== NULL) OR $this->maxHeight === NULL)


and 267
else if ($this->sourceWidth < $this->sourceHeight)

to
 else if ($this->sourceWidth < $this->sourceHeight OR $this->maxWidth === NULL)


thanks


http://www.nevalon.de
 Topic: Link between two class
Link between two class [message #7879] Sun, 25 June 2006 18:00
franck.ra  is currently offline franck.ra
Messages: 7
Registered: June 2006
Location: Paris
Junior Member

Hello,

Is there anybody who knows how i could link two classes like we could do in SQL with two table (equal join)?

I want to return the result of the join of the two classes.

Thanks
 Topic: Doctrine or other DB integration/replacement status
Doctrine or other DB integration/replacement status [message #8100] Wed, 28 June 2006 22:00
happycloud  is currently offline happycloud
Messages: 25
Registered: June 2006
Junior Member
Hi all

I see from irc/dev that there is activity in integrating doctrine as well as a solution that Francois might have?
I'm getting ready to move forward with a large project and would like an idea of the direction. I do like doctrine a lot at first glance and I see the plugins in there though I am not sure of the status of the project.

Any ideas?
Thanks
Joshua
 Topic: Common AJAX/symfony table handling?
Common AJAX/symfony table handling? [message #8265] Mon, 03 July 2006 17:56
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Folks,

I have an issue upon which I'd love to hear from any interested symfonians. My present application will make use of reasonably complex tabular layouts for form controls and data, rather like the screenshot below.

index.php/fa/92/0/

Many of these screens will offer ways to insert and delete rows depending on the particular logic rules for each one. What I'd like to achieve is a mechanism to do this in Javascript (adding or deleting table rows using the DOM) or, if that is not supported because of browser/JS issues, automatically fall back to a POST operation to do it the old way.

Each operation could reflect changes in the database upon each click (ie AJAX if possible), or a screen might require the changes to be fixed using a 'Save' button (again, AJAX if possible) so this behaviour would be configurable on a per-instance basis.

The addition of DOM/AJAX to each screen would be a real usability boon, but doing it manually represents a substantial extra investment in time, and involves plenty of wheel re-inventing. It'd be great if there was a way I could describe the behavioural rules for each table, possibly in a YAML file, and then let an symfony-AJAX amalgam worry about applying them for each case.

I am tempted to look at this at some point, although I may look at it sooner if there are other folks who could use this belt-n-braces approach to their table-handling. Any thoughts welcome and appreciated Very Happy


Remember Palestine
 Topic: Subversion Integration
Subversion Integration [message #8389] Thu, 06 July 2006 08:13
SentinelDietty
Messages: 82
Registered: May 2006
Member
Given that subversion is the recommended source control system, and that almost all open-source projects use a source control system, I would really like to see an integration system for symfony with Subversion. I would not have suggested this a day ago, however I just discovered the rsync integration, and it seems almost the same as what I'm looking for.

I don't know whether this is possible nor how much effort it would take, but I think it would be worth it.


"Doh!" - Homer Simpson
 Topic: default_culture
default_culture [message #8738] Wed, 12 July 2006 17:20
pezetgee
Messages: 734
Registered: March 2006
Faithful Member
Hi,
I've modified settings.yml and i18n.yml to change default culture from en to en_GB, but user still has culture en.
Is the default culture applied to a user automatically or do I have to set it up manually? If so, how do I get default culture settings?

Tnx
Peter



=====
Oops, sorry. I've posted this in the wrong forum...

[Updated on: Wed, 12 July 2006 17:21]

 Topic: Sub-actions
Sub-actions [message #10402] Fri, 18 August 2006 11:46
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Folks

I know there's been some talk recently about the structure of a symfony app in future releases, so I thought the following might be of interest. Individual actions can of course be separated out to individual class files, and this approach to my mind is to be applauded as it compartmentalises the logic in a clear structure. (As a side-note, I tend to find that substantial chunks of code to be executed in actions are best placed in autoloaded static classes).

I'd like to suggest that individual submit buttons within the same form (ie having the same url target) become sub-actions of some kind. Perhaps regexps defined in a yaml file might describe the form element name that must exist (and optionally the value it must have) for a specifically named action class to be autoloaded and executed?

eg a module-level yaml snippet of:

add:
  field: add_(\d+)(?:s)?(\d+)?
  value: .*


might execute the execute($field, $value) method defined in addSubaction.class.php, if the field and value regexps are matched.

Feedback/thoughts welcome.


Remember Palestine
 Topic: Running a single unit test class
Running a single unit test class [message #10880] Fri, 25 August 2006 07:45
gwylion  is currently offline gwylion
Messages: 3
Registered: August 2006
Junior Member
Hi,

I was wondering whether it would be possible to modify the SimpleTest task to be able to optionally specify a single unit test to be run. During development, I don't always want to run all the tests, every time.

See here for an example of how it could be done (second message down):
http://www.symfony-project.com/forum/index.php?t=rview&g oto=10879

Thanks!
 Topic: Control routing from database?
Control routing from database? [message #11158] Tue, 29 August 2006 20:14
Antik  is currently offline Antik
Messages: 106
Registered: July 2006
Senior Member
Is it possible?
How to load routes from database to routing.yml before "match route"?
 Topic: backward conversion for culture date and time formats
backward conversion for culture date and time formats [message #11307] Fri, 01 September 2006 16:50
p.treutner  is currently offline p.treutner
Messages: 14
Registered: February 2006
Junior Member
I'am experiencing errors using the input_date_tag helper with the javascript calendar. The problem is the input_date_tag helper uses the short date format ($value = $dateFormat->format($value, 'd')) which is d.M.yy for the czech (cs) culture. Because strtotime parses textual datetime descriptions in English only, you need to convert dates by yourself before you can call setAnything($v) methods in model classes.

There are to resolutions:
1) The quick and dirty one is to use the medium date format ($value = $dateFormat->format($value, 'p')) in the input_date_tag helper because strtotime can parse d.M.yyyy date successfully.
2) However I would appreciate some sort of standard mechanism, where I could specify a datetime description format, something like getDateAnything($format = '%x') in model classes.

[Updated on: Fri, 01 September 2006 17:01]

 Topic: Low Pro: Unobtrusive Scripting for Prototype
Low Pro: Unobtrusive Scripting for Prototype [message #11748] Fri, 08 September 2006 18:30
smallbeer  is currently offline smallbeer
Messages: 282
Registered: November 2005
Faithful Member
It's a little above my skillset but is this something that could possibly be integrated with the sfPrototype plugin?

http://www.danwebb.net/2006/9/3/low-pro-unobtrusive-scriptin g-for-prototype
 Topic: [Admin generator] Allow text option for remove link
[Admin generator] Allow text option for remove link [message #12013] Wed, 13 September 2006 12:22
COil  is currently offline COil
Messages: 466
Registered: September 2006
Faithful Member

I think all is in the title

Cool


my Symfony Blog - http://www.strangebuzz.com
The symfony web debug bar as a standalone library : PEAR::PHP_Debug
 Topic: forward method able to use a routing label with parameters
forward method able to use a routing label with parameters [message #12895] Wed, 27 September 2006 20:34
bullwinkle  is currently offline bullwinkle
Messages: 39
Registered: April 2006
Member
Hi

The forward method accepts only "module" and "action", for the most part (there is a third boolean parameter "isSlot"). It would be nice for the forward method to be able to accept a routing label WITH parameters.

For a forward wrapper that accepts a routing label, but can not do anything with possible parameters in the label, see:

http://www.symfony-project.com/snippets/snippet/97

 Topic: Object_select_tag and filter
Object_select_tag and filter [message #13080] Fri, 29 September 2006 23:55
look  is currently offline look
Messages: 1
Registered: September 2006
Location: Strasbourg - France
Junior Member
Hi all,

I want to display a list of item of a table ni database but i want to filter this.

I have tried to use the peer_method in option but i haven't getted result.

It's my code :
echo object_select_tag($animal, 'getFather', array("related_class"=>"Animal", "peer_method"=>"getMale", "include_blank"=> true)) 


I have created a method in :
class AnimalPeer extends BaseAnimalPeer 


But the method cannot filterth list, i get always all items.

Thx for your answer.
 Topic: DHTML Calendar
DHTML Calendar [message #15311] Fri, 03 November 2006 15:49
thorzombie  is currently offline thorzombie
Messages: 4
Registered: November 2006
Junior Member
Make the dhtml calendar theme configurable in some yml file. The actual aqua theme is sometimes a boring thing Smile
 Topic: sfDoctrine, Doctrine_Locking_Manager_Pessimistic and a really cool sfFilter
sfDoctrine, Doctrine_Locking_Manager_Pessimistic and a really cool sfFilter [message #15484] Tue, 07 November 2006 02:56
pminnieur  is currently offline pminnieur
Messages: 14
Registered: April 2006
Location: Germany
Junior Member
@Admin: Oops, wrong forum - I'm sorry! Could you please move it to the correct one? Thank you very much!

----

Hi,

after switching to Doctrine I have missed some things, especially the behaviors (I wrote my own pessimistic lock behavior and some other things). Today, I tried my best to figure out how I can get pessimistic locking back to my models without adding a code partial over 50 times into each model class or to modify my actions to lock / release locks manually when they're called.

So, I wrote my very first filter - sfDoctrineLockingManagerPessimisticFilter - okay, the name sucks, but it's a working title right now - the whole thing is still not stable, but I expect to have it out of beta at the end of the week Smile Here's a small copy/paste of an email I wrote earlier where I already explained how the filter works and what he does exactly:

Quote:

It locks/unlocks my records automatically, guessing the model table class name by the camelized module name and triggering on configured events (edit/create/cancel) - but it's very customizable via a filters.yml file.

I'm used to have my modules named like my models (although the model names are camelized) - so that fact_stage module refers to the FactStage model. On my test environment the filter works but throws sometimes errors when it comes to the user ident or the timestamp (lol?) - mostly its line 104 of Doctrine/Locking/Manager/Pessimistic.php but i can't figure out what's wrong there.


As you can see, the filter is also documented inline and all the possible parameters are commented in my example filters.yml - so you can try your best to customize it for your needs (and I would like you to do that and give me feedback). Feel free to contact me for suggestions or error reports - thank you.

[Updated on: Tue, 07 November 2006 03:00]

 Topic: Plans for propel to accomodate db ALTER?
Plans for propel to accomodate db ALTER? [message #17399] Wed, 06 December 2006 17:10
davidbjames  is currently offline davidbjames
Messages: 42
Registered: April 2006
Member
I was just wondering if there were any plans for propel (or doctrine for that matter) to allow db schema alteration without completely dropping the table (and losing the data). I know this has been discussed elsewhere.

My strategy would be something like this:
- Develop with sqlite
- Add test data
- Alter table as necessary (without losing test data)
Production:
- propel-build-schema (from the sqlite db)
- Change db connection to mysql
- propel-build-sql, -insert-sql
(at this point there would be no data)
- Get real data
- Alter table as necessary (without losing real data!)
 Topic: Truncate_text() option to truncate left side or center
icon3.gif  Truncate_text() option to truncate left side or center [message #19811] Tue, 16 January 2007 15:26
user2037
Messages: 7
Registered: January 2007
Junior Member
It would be helpful if the truncate_text() function included an option to truncate only the left side or the center of the string.

Typically the first and last bytes are significant. Occasionally its helpful to see only the right-most bytes; for example: incrementing, numeric keys.
 Topic: Template file extensions
icon3.gif  Template file extensions [message #21866] Sat, 17 February 2007 01:48
joshua  is currently offline joshua
Messages: 5
Registered: December 2006
Location: Darlington, SC
Junior Member
A nifty feature would be the ability use .phtml extension for template files instead of just .php. Either have sfView look for both extenions by default or just the ability set it in a yaml config file.

Why? No particular reason other than I'v gotten use to using .phtml for template files.
 Topic: symfony 2.0 suggestions - YAML validator/builder plugin
symfony 2.0 suggestions - YAML validator/builder plugin [message #22043] Tue, 20 February 2007 10:59
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Just to help kick off the suggestions for 2.0, I'd like to see a web-based plugin to help validate and/or edit various yaml settings around symfony, to speed the process for advanced programmers and to lessen the learning curve for symfony beginners. In particular this might offer a mechanism to help encode bracketed logic (eg (x AND y) OR (z)) to validate screens, which can be fiddly when defining in YAML.

We've not upgraded to 1.0 yet but if I get some time once we do, and if this idea has not already been taken up by then, I may have a go at this myself. Comments/suggestions welcome.

http://www.symfony-project.com/trac/wiki/Symfony2Discussion

[Updated on: Tue, 20 February 2007 11:00]


Remember Palestine
 Topic: link_to and direct_access option
link_to and direct_access option [message #22650] Wed, 28 February 2007 11:33
youx  is currently offline youx
Messages: 5
Registered: December 2006
Junior Member
Hello,
Using Symfony 1.0, I've noticed that the direct_access option for link_to has disappeared since last versions.
Is there another way to do what this option was doing.
I actually use it in order to directly target files and want to avoid the /my_app.php prefix.
Maybe I missed something...
Thanks for the tips
 Topic: nice to have list
nice to have list [message #24389] Sun, 25 March 2007 08:28
Harald  is currently offline Harald
Messages: 9
Registered: March 2007
Junior Member
Not everything must allways be discussed. This is just a list with features and changes, brainstorming, for inspiration. May be there are some features allready there and i didn't found them, or they are allready in work. May be i do some work on it ...

  • "navigationHelper", with templates and multiple levels, marking active pages and so on.
  • "(x)htmlValidator" checking html/xml text against DTDs, relayNG and xml schemas. It should support subsets.
  • "dev_xhtml_checker" for the hole page displaying a status symbol (is valid, not valid) in the sfWebDebugBar.
  • "requestArrayValidator", extensible with existing validators and some optional setup.
  • "add_paragraphs textHelper" which adds valid <p> and <br />-tags on each text containing (x)html.
  • "themes" - needs to rewrite some elements of constants.php by configuration files.
 Topic: [BUG] object_input_date_tag
[BUG] object_input_date_tag [message #24541] Tue, 27 March 2007 17:06
andersonvom  is currently offline andersonvom
Messages: 58
Registered: September 2006
Member
I'm not sure if this is the right place to place this, but here we go.

The object_input_date_tag function doesn't work properly with the array('disabled'=>'true') option. Is it supposed to be like this? The field is, indeed, disabled but I'm still able to change the date through the little button (...) next to it.

Regards!
 Topic: propel-build-all check and alert function
propel-build-all check and alert function [message #25343] Mon, 09 April 2007 10:12
mlier  is currently offline mlier
Messages: 101
Registered: May 2006
Senior Member
Could be useful to have an alert when you do a "symfony propel-build-all" function.

Could check that database definition in :
  • propel.ini (propel.database.url)
  • database.yml (dsn: mysql://...)

are the same.

If there are not, an alert could be written to check with the user that he does want to go further.
It avoid to destroy another database by forgetting to change propel.ini definition. I am in that case Smile.

 Topic: count ($sf_request->getErrors('Error'))
count ($sf_request->getErrors('Error')) [message #26185] Tue, 24 April 2007 10:40
nhauyen318  is currently offline nhauyen318
Messages: 6
Registered: November 2006
Junior Member
I'm using :

$this->getRequest()->setError('Error','error message')
and i have a lot of errors, but

count ($sf_request->getErrors('Error')) = 1
It's not correct, actually count ($sf_request->getErrors('Error')) = 3

Please show me to use $sf_request->getErrors().

Thanks so much
 Topic: ajax action/template automatic detection
icon3.gif  ajax action/template automatic detection [message #26755] Sun, 06 May 2007 16:25
florynth  is currently offline florynth
Messages: 185
Registered: January 2007
Location: Québec - Montréal
Senior Member
Have the execution filter detect if the request is ajax and then call another function if it's ajax.

Exemple

class myAction extends sfAction
{
    //Call if neither ajax/exe exist
    //If you want just ajax or exe to be
    //call you don't define this method so
    //action filter will throw a sf404... if
    //the proper method doesn't exist
    public function execute()
    {
        ...
    }
    //Call if it's ajax
    public function ajax()
    {
        ...
    }
    //Call if it's not ajax
    public function exe()
    {
        ...
    }
}


Also like the xxxSuccess.altbody.php for the sfMailView.class.php we could have a xxxSuccess.ajax.php who's call if available when it's XML request.

[Updated on: Sun, 06 May 2007 16:56]


The best way to improve your Symfony knowledge is to read the source code !
When you start a project two main issues : database and security.
Sorry for my english, my first language is french.
Working for : http://www.tribalnova.com
 Topic: override file flag in propel generator
override file flag in propel generator [message #26756] Sun, 06 May 2007 16:27
florynth  is currently offline florynth
Messages: 185
Registered: January 2007
Location: Québec - Montréal
Senior Member
be sure that if file exist whe calling a symfony propel-generate-** we should specify a parameter to confirm that we want to override files (actions.class.php, templates/*) if they already exist


The best way to improve your Symfony knowledge is to read the source code !
When you start a project two main issues : database and security.
Sorry for my english, my first language is french.
Working for : http://www.tribalnova.com
 Topic: pake task to generate plugins module instead of application modules
pake task to generate plugins module instead of application modules [message #26758] Sun, 06 May 2007 16:33
florynth  is currently offline florynth
Messages: 185
Registered: January 2007
Location: Québec - Montréal
Senior Member
The title is self explanatory:

pake task to generate plugins module instead of application modules

To generate modules into plugins directory, we just have to change the first parameter of the standar pake action to be the plugins name instead of the application name.


The best way to improve your Symfony knowledge is to read the source code !
When you start a project two main issues : database and security.
Sorry for my english, my first language is french.
Working for : http://www.tribalnova.com
 Topic: Another filter to modify post/get data
Another filter to modify post/get data [message #26759] Sun, 06 May 2007 16:37
florynth  is currently offline florynth
Messages: 185
Registered: January 2007
Location: Québec - Montréal
Senior Member
A new filter to modify the post/get data just before the validation filter.

Exemple in a fictive cms/faq module, if you want your new 'Question' for a faq to be trim before it pass the validation since it need to be unique and your model will trim it.


The best way to improve your Symfony knowledge is to read the source code !
When you start a project two main issues : database and security.
Sorry for my english, my first language is french.
Working for : http://www.tribalnova.com
 Topic: have the routing.yml recursive for plugins
have the routing.yml recursive for plugins [message #26761] Sun, 06 May 2007 16:40
florynth  is currently offline florynth
Messages: 185
Registered: January 2007
Location: Québec - Montréal
Senior Member
We are now suppose to add to our routing.yml file the new routing rule for a pluggin. It would be nice that the routing.yml could be recursive like other configuration file. I know you could change the routing rule into the config.php file of the plugins but Symfony is all about standardisation !


The best way to improve your Symfony knowledge is to read the source code !
When you start a project two main issues : database and security.
Sorry for my english, my first language is french.
Working for : http://www.tribalnova.com
 Topic: sfError403Exception.class.php
sfError403Exception.class.php [message #26762] Sun, 06 May 2007 16:42
florynth  is currently offline florynth
Messages: 185
Registered: January 2007
Location: Québec - Montréal
Senior Member
A sfError403Exception.class.php for security access reason in actions. All method like the one for the sfError404Exception.class.php will be present :

$this->forward403Unless(...);
$this->forward403If(...);
...


The best way to improve your Symfony knowledge is to read the source code !
When you start a project two main issues : database and security.
Sorry for my english, my first language is french.
Working for : http://www.tribalnova.com
 Topic: a more granular sfExecutionFilter.class.php
a more granular sfExecutionFilter.class.php [message #26763] Sun, 06 May 2007 16:50
florynth  is currently offline florynth
Messages: 185
Registered: January 2007
Location: Québec - Montréal
Senior Member
Have the sfExecutionFilter->execute() be more granular (by adding method call) to be able to extends the class to create our own extension of sfExecutionFilter more easily.

If I want to extends it to add some small functionnality in the execution process I need to copy/paste everything and if you change something in the object code I will not have the update if I don't read update manually my file.


The best way to improve your Symfony knowledge is to read the source code !
When you start a project two main issues : database and security.
Sorry for my english, my first language is french.
Working for : http://www.tribalnova.com
 Topic: Whitespace should not be valid for required fields
Whitespace should not be valid for required fields [message #27697] Sun, 20 May 2007 18:59
robrosenbaum  is currently offline robrosenbaum
Messages: 5
Registered: May 2007
Location: Ann Arbor, MI
Junior Member
In almost all cases, a form field containing only whitespace should not pass validation if the field is required. Currently, you have to use a validator to check for whitespace, in addition to declaring the field required. I've attached a patch that changes that. It allows for a variable that, if set, reverts to the old behavior. The patch also includes this patch, for the same line of code:
http://trac.symfony-project.com/trac/ticket/1649


-Rob Rosenbaum
http://www.robrosenbaum.com/
 Topic: Statistics Package for Symfony
Statistics Package for Symfony [message #28267] Tue, 29 May 2007 04:32
topherdan1  is currently offline topherdan1
Messages: 5
Registered: May 2007
Junior Member
It would be cool to have an internal statistics package plugin for symfony. It could maintain a log of the usage of the application.

In case anyone is interested, I have a quick and dirty version that I've started using:

In the Action:

  public function postExecute()
  {  
    $log = AuditPeer::doLog($this->getUser()->getSubscriberId(), $this->getModuleName(), $this->getActionName(), session_id(), $this->getRequest()->getReferer(), $this->getRequest()->getUri(), $_SERVER['HTTP_USER_AGENT']
  }



In the Model:

 public static function doLog($userId, $module, $action, $cookie, $referer, $url, $userAgent)
  {
    $log = new Audit();
    
    //if the user is logged in, set the UserId variable
    if($userId <> '') { $log->setUserId($userId); }    
    
    //now set the info to be logged
    $log->setModule($module);
    $log->setAction($action);
    $log->setCookie($cookie);
    $log->setReferer($referer);
    $log->setUrl($url);
    $log->setUserAgent($userAgent);
        
    $log->save();
  }

[Updated on: Tue, 29 May 2007 04:48]

 Topic: api doc & cli
api doc & cli [message #29463] Fri, 15 June 2007 15:50
xammax  is currently offline xammax
Messages: 16
Registered: April 2007
Junior Member
In my wishlist I've at least 2 requests:

1) api documentation via CLI (retrieve info from a sqlite db in local box), eg: symfony help link_to
2) manage versioning via Symfony CLI (built on top svn or rcs or something else), eg: symfony scm commit (project|apps|mod); symfony scm revert (project|apps|mod) -2; etc. etc.

max
 Topic: php-ids
php-ids [message #29865] Thu, 21 June 2007 11:15
aem_  is currently offline aem_
Messages: 7
Registered: November 2006
Location: montpellier
Junior Member
hi,

i've just seen this project :

http://php-ids.org/

do you think, even as a plugin,
that it could be useful for symfony projects ?
 Topic: I18N and validation yml files
I18N and validation yml files [message #29918] Thu, 21 June 2007 23:18
Stasy  is currently offline Stasy
Messages: 30
Registered: January 2007
Member
I need to translate the error messages that are defined in the validation yml files. I could not find a solution neither in the documentation nor in the forums.
When using PHP code inside the YML files like Tjorven did (http://www.symfony-project.com/forum/index.php/t/5060/), the messages are translated once when the cache files are being created. But after that the messages of course do not change when the culture is switched. That's because the messages are "hardcoded" in the cache files.

As form errors occur in almost every web application, I think there should be a permanent solution for this!

My thoughts about a possible solution are as follows (yml):
names:
  user:
    required:          true
    required_msg:      %1% is to short. Minimum is %2% characters.
    translate_msg:     true
    parameters:        [%1% = <?php echo sfContext::getInstance()->getRequest()->getParameter('user') ?>, %2% = <?php echo sfConfig::get('user_min_length') ?>]
    dictionary_file:   login
    validators:        [userValidator, anotherValidator]

I suppose the next problem is how to handle the PHP code inside the yml file as it must not be cached. It has to be updated whenever a validation error occurs in order to display the right translation according to the actual culture.
I think that Tjorven's solution would work if the validation files are not cached. On the other hand, not caching at all would be bad for performance, so maybe with my proposal it could be cached at least partially (only the parameters-parameter must not be cached).
 Topic: New plugin wanted like Drupal's Signwriter
New plugin wanted like Drupal's Signwriter [message #31697] Wed, 18 July 2007 18:28
rickb  is currently offline rickb
Messages: 61
Registered: July 2007
Location: Hampshire, UK
Member
Hi all,

Is anyone thinking of developing a plugin like Drupal's Signwriter http://drupal.org/project/signwriter?

The sIFR plugin (http://trac.symfony-project.com/trac/wiki/sfSIFRPlugin) is similar but distinctly different: sIFR uses Flash to allow you to change the font of headings by putting a dynamically-generated Flash object in front of a heading, whereas Signwriter uses images (typically PNG) to replace headings with graphics displaying the same text. If you want a fancy background, you need to use image replacement rather than sIFR. If all you want is fancy fonts, sIFR is probably easier and lighter weight.

What I'd like to do is the image replacement technique. In the past, I've done this on my website (http://www.whr.co.uk) using an offline tool (actually written in Java) to prepare heading graphics and modify the pages to display them. Now that I'm familiar with the GD library, it actually offers a simpler way to do the same thing but dynamically. Drupal's Signwriter happens to be a nicely complete implementation.

But (not surprisingly to most readers here) I want to use Symfony rather than Drupal. There is a gap in the plugins available - we don't yet have one that imitates Signwriter.

Anyone fancy this challenge?

[Updated on: Wed, 18 July 2007 18:28]


Rick
Pages (169): [ «  <  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  >  »]

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software