parameters

how to set my own paramers and config symfony2

浪子不回头ぞ 提交于 2019-12-11 11:04:44
问题 i want to use my own parametes.ini file in my symfony project. does anyone know about that? I know this file #app/config/parameters.ini but I wnat to include my own one. 回答1: In your app/config/config.yml there are lines: imports: - { resource: parameters.yml } - { resource: security.yml } Just add your file there. imports: ... - { resource: your_custom_file.yml } Your custom file should be located in app/config directory. In case if you would like to include file from Bundle - you can import

How to use / pass parameters to event handlers?

99封情书 提交于 2019-12-11 11:04:31
问题 I already found some information about this topic, but I still don't fully understand it and would be happy if someone would show me how to do it on my example. Basically, I've got an array filled with objects in VB.Net Windows Forms Application Dim button(9) As cbuttons public sub fill() button(1) = New cbuttons("buttonName1", 2, true) button(2) = New cbuttons("ButtonName2", 3, true) button(3) = New cbuttons("ButtonName3", 4, true) ... This array serves as a source for buttons, which are

How to use the same method with two different forms?

末鹿安然 提交于 2019-12-11 11:03:39
问题 To clarify: I have two forms that use the same method in my Controller, and I was wondering how to use the same lines of code rather than copying and pasting the method and using a different parameter for each method. Eg. What I have now: public static void PopulateOriginCombo(CableID_QueryView QView) { if (QView.cmbAreaCode.Text != "") { //Code... } } public static void PopulateOriginCombo(CableID_CreateView CView) { if (CView.cmbAreaCode.Text != "") { //Code... } } Can I combine the

How to call a method and send new parameters in RoR?

六眼飞鱼酱① 提交于 2019-12-11 10:50:17
问题 Let's say I have methodA def methodA note = Note.find(params[:id]) note.link = params[:link] note.linktype = params[:linktype] note.save redirect_to(notes_url) end When I call this method from a view like this, it works fine <%= link_to image_tag(w.link, :border =>0), methodA_path(:linktype => w.linktype, :link => w.link, :id => @note.id) %> But, if I call the method from another method in the same controller like this: def methodB ... methodA(:id => params[:id], :link => link, :linktype =>

Subclass vs Wrapper - Constructor With An Additional Parameter

匆匆过客 提交于 2019-12-11 10:43:01
问题 Which is generally considered the more preferred method when trying to add a constructor with an additional parameter? A subclass or a wrapper? That being, creating a subclass of the class and then just using that subclass' constructor? Or adding a wrapper method which will take the extra parameter and return an object with that parameter set? Thank you for your time! EDIT: I don't have access to the superclass's code. 回答1: The answer is language dependent. In C#/.NET, you would typically use

How to count zeroes with specific parameters

£可爱£侵袭症+ 提交于 2019-12-11 10:41:51
问题 I need to count an amount of zeroes. So far this code works: private void textBox1_TextChanged(object sender, EventArgs e) { if (uFCheckBox.Checked == true) { nFCheckBox.Checked = false; pFCheckBox.Checked = false; decimal x = 0; if (Decimal.TryParse(textBox1.Text, out x)) { var y = 1000000; var answer = x * y; displayLabel2.Text = (x.ToString().Replace(".", "").TrimStart(new Char[] { '0' }) + "00").Substring(0, 2); string myString = answer.ToString(); // displayLabel5.Text = myString.Split('

Awesomnium Post Parameters

隐身守侯 提交于 2019-12-11 10:34:49
问题 currently i am working with Awsomnium 1.7 in the C# environment. I'm just using the Core and trying to define custom post parameters. Now, i googled a lot and i even posted at the awsomnium forums, but there was no answer. I understand the concept, but the recent changes just dropped the suggested mechanic and examples. What i found: http://support.awesomium.com/kb/general-use/how-do-i-send-form-values-post-data The problem with this is, that the WebView Class does not contain

PDO Error “parameter was not defined” even though I've defined and bound that parameter

南楼画角 提交于 2019-12-11 10:32:39
问题 I'm trying to convert this login script from mySql to PDO, and the SELECT statement works fine for user_name but not for password. The error message displayed is "SQLSTATE[HY093]: Invalid parameter number: parameter was not defined ". Do I need to bind $hashedPassword differently for this statement? <?php session_start(); //Include database connection details & salt $password = $_POST['password']; $hashedPassword = sha1($salt . $password); try { $stmt_user = $conn->prepare("SELECT * FROM

Flow depending on external parameter?

心已入冬 提交于 2019-12-11 10:31:47
问题 I'm building a simple POC to experiment with Faces Flow. page 1: displays a list of companies. The user selects company A then goes to page 2. page 2: on the selected company page, the user clicks a commandLink to start a wizard to create a new employee to be added to the company A. Behing the scenes I've got a @FlowScoped("addNewUsertoCompanyFlow") bean MyFlowBean . In its @PostConstruct method, the MyFlowBean needs to fetch an object corresponding to the company A from a service ( @Inject )

Scala class that handles enumerations generically

时光怂恿深爱的人放手 提交于 2019-12-11 09:54:21
问题 I want to create a generic class that holds the value of an enumeration, and also allows access to the possible values of the enumeration. Think of a property editor for example - you need to know the current value of the property, and you also need to be able to know what other values are legal for the property. And the type of enumeration should not be known in advance, you should be able to work with any kind of enumeration. My first thought was something like this: class