Jump to content

Gil Ronen

Clients
  • Posts

    53
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by Gil Ronen

  1. On 3/15/2021 at 4:16 PM, CodingJungle said:

    about all it does for "templates" is in a limited fashion gives you a template function list for getTemplate (based on the group param) and if it finds the template, will give you param hints (but this is only in phpstorm and if you have the phptoolbox plugin installed for phpstorm).

    2021-03-15_09-06.thumb.png.cb88080c0c8167db6bbb81d735051fe9.png

    for an IDE like phpstorm, i usually assign *.phtml to twig in file types, it doesn't do much, but does add some color.

    before being assign to twig:

    2021-03-15_09-12.thumb.png.412fb325b266729e462a63ca26774262.png

    after being assigned to twig:

    2021-03-15_09-13.thumb.png.a5a0698deff07eaaead49d3a1eedd405.png

    but other than that, there isn't any plugin i know of that will assist with IPS templates and i'm not crafty enough with java to make one 🙂 

    Can you show how you setup your twig? it looks really bad when I try to set it up

    image.thumb.png.d61bb1f3c172fc5a7642c9226d0e09ba.png

  2. 14 minutes ago, Stuart Silvester said:

    You may also want to consider using a profile field and then reading the value of that field in your application.

    The field I need has to be on the registration form, I couldn't find how to do it.

    1 hour ago, Adriano Faria said:

    Quick example, obviously not tested:

    
    	/**
    	 * Build Registration Form
    	 *
    	 * @return	\IPS\Helpers\Form
    	 */
    	public static function buildRegistrationForm( $postBeforeRegister = NULL )
    	{
    		$form = parent::buildRegistrationForm( $postBeforeRegister );
    		$form->add( new \IPS\Helpers\Form\Text( 'field_name', NULL, TRUE ), 'password_confirm' );
    		return $form;
    	}
    
    	/**
    	 * Create Member
    	 *
    	 * @param	array 		$values   		    Values from form
    	 * @param	array		$profileFields		Profile field values from registration
    	 * @param	array|NULL	$postBeforeRegister	The row from core_post_before_registering if applicable
    	 * @return  \IPS\Member
    	 */
    	public static function _createMember( $values, $profileFields, $postBeforeRegister = NULL )
    	{
    		$member = parent::_createMember( $values, $profileFields, $postBeforeRegister );
    
    		$member->field_name = $values['field_name'];
    		$member->save();
    
    		return $member;
    	}

     

    It worked, excatly what I needed, thanks!

  3. Hey,

    I want to add a field to the registration form, just a normal text field to add to the core_members table and I will use this field on my app, Its the first time Im using hooks for my app.

    I know I need to hook to this class \IPS\core\modules\front\system\register but I cant make it work.

    I dont know to which function adds the fields.

    Please help, Thanks.

×
×
  • Create New...