Jump to content

Fetching Id From Url To Mysql Database In Prestashop Controller


zmaxunder

Recommended Posts

I have made a controller known as "AdminTimelinePage" where I can add a form and it shows in the helperlist with a button customize. After clicking "customize" it redirect to fill helperform.

 

The code also passes its ID in url as "?controller=AdminCustomTimelinePage&id=35"

 

I am trying to fetch ID=35 and insert it into the parent ID field

 

I tried all the methods in controllers but none is working. This is the class file (CustimeTimeline.php) $id_parent_page = $_GET('id'); method is also not working.

public $custom_page_type;
public $id_parent_page;
public $title_custom_page;
public $description_custom_page;
public $timeline_year_custom_page;
public $gallery_type_custom_page;
public $active;

public static $definition = array(
'table' => 'custom_pages',
'primary' => 'id_custom_pages',
'fields' => array(
'id_parent_page' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => false),
'title_custom_page' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
'timeline_year_custom_page' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'required' => false),
'description_custom_page' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml', 'size' => 3999999999999),
// 'type_custom_pages_detail' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => false),
'active' => array('type' => self::TYPE_BOOL),
),
);
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...