I would pass the id as an option to the form (if the id is decided in
the action, and cannot be derived from the object itself) then add the
value using the updateObject() method. Since the value never enters
userland, there is no real need to run it through the validators in
this case, so I'd just
You could also of course (instead of using a form option) populate the
object before passing it to the form, or after you have bound the
form, before calling save. (if you want to keep the account_id logic
completely out of the form class).
Russ.
On Feb 5, 10:30 pm, "rooster (Russ)"
This is not a good solution as your libs will be referencing the
context you create, and not the singleton that is running your app. It
may seem to work, since the configuration will be identical - but it's
really not a good solution.
You have 2 options in my opinion.
1. Dirty: Create an sfContex
The definitive guide will be released (under a different name) some
point soon, in the meantime - the forms docs for 1.2 are pretty much
the same so give those a whirl!
Check out Appendix A and B (widgets and validators) any you can't go
far wrong.
Russ.
On Feb 22, 2:49 pm, Diego Bello wrote:
>
Symfony forms by default use arrays, you've maybe just never noticed?
when posted this is an array... post array: array("user" =>
array("email" => "something", "comment" => "somethingelse"));
It helps when binding the form, because then you just pass the "user"
part and not any other junk that
On Feb 23, 8:13 am, Gareth McCumskey wrote:
> To answer make the value of the hidden field equal to the serialized
> array
>
> http://www.php.net/serialize
>
Ah yes I misunderstood the question - in my example it is possible but
a bit silly because you'd need a bunch of hidden fields. If
Hi,
Despite the fact there won't be behaviours as such, there will almost
certainly be Doctrine extensions which emulate what you would expect
from behaviours, and I think for those symfony-specific cases there
will be Bundles for sure.
We have already implemented a changelog "behaviour" in Doctr
On Mar 14, 7:24 pm, vero wrote:
> my main.css is:
>
> *{
> width:800px;
>
> }
Seriously?
You are setting the width of the first found element to 800px - which
in your case is the sf logo.
http://www.w3.org/TR/CSS2/selector.html#universal-selector
I imagine this works in the frontend because
Oh, and install Firebug... You would have spotted the problem straight
away by selecting the element and looking to see which css rules were
applying to it, and where they were coming from.
Russ.
On Mar 14, 8:15 pm, "rooster (Russ)" wrote:
> On Mar 14, 7:24 pm, vero wrote:
>
&g
I suggest you have a quick read through the form book (1.2 is still
pretty much valid for sf1.4) because all this is pretty much covered
there.
To set a default value for a date widget to today, you could do
something like this in your form configure() method:
$this->setDefault("my_date_widget",
The i18n helper is quite simple in what it does. If it does not find a
target translation it will simply return what was passed.
You have a few of ways to get round this:
1. Write your own (override the) __() function So it checks if the
string returned is identical, if it is - then you can invok
Hi,
You should probably bring this up on the symfony-devs mailing list.
regards,
Russ.
On Mar 26, 3:28 am, Donald wrote:
> I assume the right people will see this message...
>
> I've been submitting tickets for symfony since about Sept 2008, and I
> used to have a very good response in getting
On Apr 14, 10:13 pm, Peter Petrik wrote:
> hi,
>
> i am wondering , it is possible to use doctrine2 with symfony 1.4 (is
> there any plugin that supports it?)
>
> tnx.
>
> peter
Also this more recent blog post:
http://eatmymonkeydust.com/2010/03/using-doctrine-2-with-symfony-1-x-part1/
--
If
A quick check of the source code will tell you all you need to know...
save() is a wrapper function, that runs doSave() inside a transaction
doSave() first calls updateObject() then calls save() on the object
itself.
updateObject() is a method called just before the object is actually
saved, it'
Just a quick note The Form helper is Deprecated, so if you are
thinking of moving to Symfony 1.3/1.4 any time - I'd advise against
using the form_tag() function. It's really the only thing you are
using the helper for, since all the other widgets etc. are provided by
the forms framework.
Russ.
On Apr 30, 7:37 pm, Tom Haskins-Vaughan
wrote:
> I've been thinking about using 'keys' instead of full sentences:
>
> echo __('layout.greeting');
>
> But is this an acceptable/symfony way to do it?
>
>
Symfony won't tell you off if you do, it's up to you. There are pros
and cons really...
Th
I find this entire discussion kind of strange... If you want to add a
class to *all* list elements then it would make much more sense to add
a class the the and use:
ul.clearfix li { }
in your stylesheet. The only reason to apply the class directly to the
element would be if it only applied in
Please remember that sfContext::getInstance() is evil and kills
kittens...
http://eatmymonkeydust.com/2009/08/symfony-forms-flexible-widgets-based-on-user-credentials/
On May 8, 9:49 pm, Billy Paradise wrote:
> Thanks for such quick responses!
>
> $this->setPostedBy(sfContext::getInstance()->ge
Are you using Firebug to check the response? You will probably see
that javascript_helper is "undefined" since you are calling it in your
action without explicitly loading it.
Try manually writing the javascript tags for now... just for fun.
Remember you can also do $this->renderPartial() and $th
The biggest issue is security... You have a cache folder with 777
permissions which anyone else on the same host can write to and
execute arbitrary PHP code.
Some shared hosting providers get round this by using chroot jails and
a number of other tricks, but you need to make sure the one you are
u
On Jun 6, 9:21 am, Ragnis wrote:
> I can't learn it if I can't get it to work.
>
> Theese "framework guys" never think about those who are using shared
> hosting.
The way restrictive shared hosts set up their environments causes
problems for any kind of decent sized web application, not to ment
Sounds like you are trying to do something that breaks standards...
Why would you want a tag that does not link to a form element?
Maybe you want to use an or or some other element?
Which part of the widget would be the label? The value?
How about getDefault("my_widget_name"); ?>
You can also
Have you even tried to contribute to the original plugin first?
On Aug 29, 6:16 pm, Maxim Oleinik wrote:
> Does anybody use subj?
> I found sfDoctrine2Plugin but it seems to be outdated.
> So i've forked it, fix some tasks and etc.
> If anybody interested my
> fork:http://github.com/maxim-oleini
On Jun 6, 8:54 pm, PaulK wrote:
> Hi all,
>
> I was wondering if anyone has experience with using Doctrine2 in combination
> with Symfony1. The company I work for has build an SF1&D1-based back end
> application, which I took part in. We have, in the meantime, started on a
> front end project, w
There are several decisions to make here really:
Adding it to a global js file is a good way to go, especially if you
have a far-future expires header because then the extra "bloat" is not
an issue. However if you have lots of template specific code there
then it may be a bit out of place, for ex
You need virtual hosts... it depends on your system regarding the
setup, but if you google for "apache virtual host" you should get a
ton of stuff.
Shout back if you have any problems with it.
On Jul 8, 3:04 pm, JPL wrote:
> Hi I try to use two symfony on the same server. I only have one IP
> a
This is normal behaviour on pretty much any website. Your browser has
cached the page, not the server - and when you click back it simply
shows you the page you were just looking at, without any request to
the server at all.
Try it on a few other web sites that have login forms - you'll find
it's
Hi,
it's mainly down to preference as $product->Category->name utimately
invokes $product()->getCategory()->getName() anyway, as would $product
["Category"]["Name"]
Check
http://www.symfony-project.org/doctrine/1_2/en/06-Working-With-Data#chapter_06_altering_data
And
http://www.doctrine-projec
Hi,
save() is functionality that requires an "object" form, so your form
needs to extend a "BaseFormDoctrine" or Propel equivalent, normally
via a "BaseMyClassForm".
Since your form has no reference to an object, there is nothing to
save.
I'd suggest having a quick blast through the docs
http:/
Well, since the functions will be called anyway, there is a very
marginal overhead when using property access (since they invoke the
php magic __get() method) - it's not something you should worry about
though.
In most cases using array access is the way to go, because it means
you can switch bet
I think Asim has misunderstood...
You are trying to get the values posted with the form right?
In the form class you can use $this->getValues() or $this->getValue
("name") for example.
If you are (for some reason) not using the form class to process the
results, and you are trying to access the
> Can i use some thing like $_SESSION['name']="asim";
>
> in symfony
That's pretty much exactly what this explains:
http://www.symfony-project.org/book/1_2/06-Inside-the-Controller-Layer#chapter_06_sub_session_management
--~--~-~--~~~---~--~~
You received this me
On Sep 13, 9:05 am, pcummins wrote:
> How do I get the message from a call to $this->forward404() into a
> customized error404Success.php template?
Your custom template should have a variable called $exception, which
is the sfError404Exception object... The message is the exception
message ($exc
04(" throwing an error the way that sample code in
> documentation is ")}
>
> [code]
>
> Any thoughts?
>
> Using latest symfony 1.2.8
>
> On Sun, Sep 13, 2009 at 7:49 AM, rooster (Russ) wrote:
>
>
>
> > On Sep 13, 9:05 am, pcummins wrote:
&g
I'm actually surprised it isn't already, which why I wonder
if I've overlooked something...
Russ.
On Sep 14, 11:34 am, Lee Bolding wrote:
> On 13 Sep 2009, at 18:12, rooster (Russ) wrote:
>
> > In the meantime, unless anyone else can think of something, the o
On Sep 15, 6:34 am, Casey wrote:
> I haven't tried this, but since it is a forward, can you set a request
> attribute that can be accessed by the 404 action?
That's pretty much what I was getting at! The problem is still that
you'd have to set it before calling one of the forward404 functions.
On Oct 6, 9:41 pm, Josh wrote:
> Hi all:
>
> I'm still pretty fresh to Symfony so bear with my newbie questions and
> confusions.
>
> Here's the deal:
>
> $this->product = new Product; // from BaseProduct::Product
>
> $obj = $this->product->save();
>
As far as I can tell - saving a record does n
Options are passed as an array to the second argument.
$this->form = new ContactForm(array(), array("firm" => $firm));
Then in your form class:
$this->getOption("firm");
Although in your case - if you are just trying to set defaults you can
use the first array for that.
On Nov 8, 10:10 pm, dz
Probably the easiest way to solve this would be to ensure your urls
don't contain spaces in the first place.
If you are generating urls based on user generated input (user name,
article name etc) then look into creating slugs for this purpose.
I'm pretty sure the symfony routing simply makes use o
Is user1 the primary key, or part of the primary key for this table?
Doctrine always includes the primary keys in it's hydration since it
needs them to organise things.
You could try:
$this->friend_list = Doctrine::getTable('FriendReference')
->createQuery(')
->from("FriendReference a
On Dec 1, 2:10 pm, Gareth McCumskey wrote:
> I stand open to correction but I believe that ALL fields need to have a
> validator applied, even if that validatoion is nothing. Just check that you
> have a validator applied to each form widget.
>
> On Tue, Dec 1, 2009 at 1:56 PM, Hong Kil Dong wrot
Antoine S. wrote:
> I used a lot with propel the possibilty to add a criteria to a
> generated function.
>
> Example : a product has categories, it will generate :
>
> public function getProductCategories($criteria = null, $con = null)
> {
> }
>
> and then I could easily refined with a criteria.
On Nov 11, 10:27 pm, domnuprofesor wrote:
> Hi there!
>
> I'm switching a website to symfony that has over 180k pages indexed by
> google.
> Each page need quite a bit of server logic to redirect to the new
> pages.
> My problem is that I'm not sure I'm doing things write (and fast) in
> symfony
Some discussion about this here:
http://forum.symfony-project.org/index.php/m/56343/#msg_56343
On Feb 2, 8:11 pm, DoRiaN wrote:
> Up please :)
>
> On 1 fév, 17:44, DoRiaN wrote:
>
>
>
> > Hello (i'm french, excuse me for my english),
>
> > How to set trim default option on all widgets in a Form
44 matches
Mail list logo