Search

i am creating a field extension, basically copying and pasting from selectbox_link.

but how do i get the entry_id of current entry which i am editing? I tried to get it from “context”

like

$this->_Parent->context();
$this->_context,
$this->Context()

which all fail..

Class fieldacl_php extends Field

    ...

public function displayPublishPanel(){

    $adminpage = $this->_Parent->_Parent->_Parent->getPageCallback();
    $entry_id = $adminpage['context']['entry_id'] ;

Please keep in mind that $this->_Parent->_Parent->_Parent->getPageCallback(); will no longer work in the upcoming Symphony 2.2 release. You’ll have to replace it with Symphony::Engine()->getPageCallback();.

You can find more information about this change here:
http://getsymphony.com/discuss/blog/entry/a-guide-to-accessor-changes-in-symphony-22/.

There should be no need for any of that. Check the core field class’s method signature, entry_id is passed as a parameter to displayPublishPanel

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details