Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-28-2011, 05:00 AM   PM User | #1
new_to_this
New Coder

 
Join Date: May 2011
Posts: 20
Thanks: 5
Thanked 0 Times in 0 Posts
new_to_this is an unknown quantity at this point
Add new form field into complex website template... Any ideas?

Hi

I am new to complex coding.

I am trying to add an extra field to a website that is a complex template.

It appears that each field in the sign up form has a php page. Here is the 'Your name' coding that i think is for the form field that is driven through php.

Code:
<?php

class field_i_am extends fieldType_select
{
	/**
	 * Constructor.
	 *
	 * @param string $name
	 */
	public function __construct( $name = 'i_am' ) {
		parent::__construct($name);
	}
	
	
	public function setup( SK_Form $from )
	{
		// TODO: getting values from database
		$this->values = array(1, 2, 4, 8);
		
		$this->setValue(current($this->values));
		
		parent::setup($from);
	}
	
}
And the code that calls it:

Code:
<?php

class component_SignUp extends component_FieldForm
{
	
	public function __construct( array $params = null )
	{
		if (SK_Config::section('profile_registration')->type == 'invite') {
			$this->annul();
		}
		
		parent::__construct('sign_up');
		
		$this->enable_sections = false;
		//$this->cache_lifetime = 10;
	}
	
	public function fields(){
		return array('username', 'password','email','i_agree_with_tos');
	}
		
}
I think it appears to be a very complex and confusing system.

If someone knows, how would i add a new field to this template in the sign up form? I want to add a 'Surname', and use this current code as listed above as a 'First Name' field.

I'm really baffled on this. Any input would be great!

If you have a thought and would like to see other code from the template then easy, just ask...

thanks
steve
new_to_this is offline   Reply With Quote
Old 05-28-2011, 08:16 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,162
Thanks: 59
Thanked 3,992 Times in 3,961 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
And how is this related to MySQL?
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 05-29-2011, 12:22 PM   PM User | #3
new_to_this
New Coder

 
Join Date: May 2011
Posts: 20
Thanks: 5
Thanked 0 Times in 0 Posts
new_to_this is an unknown quantity at this point
yes you are right, sorry for any inconvenience
sc
new_to_this is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:13 PM.


Advertisement
Log in to turn off these ads.