Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Access data 20 Jun 2017 12:26 #15221

  • dyvel
  • dyvel's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 200
  • Thank you received: 11
Hi

I've been away from component development for a long time. I have a few questions, as I'm trying to get my head around it.
I've created a Fly on an item view, where I have data from related tables. I have also added a custom button on the item view.

When clicking the button, I'm trying to access this related data, but not sure how.

$model = $this->getModel();
$item = $model->getItem();

Doesn't contain any of those related data.

Any help is greatly appreciated :-)

Please Log in or Create an account to join the conversation.

Access data 22 Jun 2017 21:55 #15227

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
did you write your custom code (custom task & redirection) in the right controller file ?
	/**
	* Method to custom an element.
	*
	* @access	public
	*
	* @return	void
	*/
	public function custom()
	{
		// TODO : Write your custom code here

		$model = $this->getModel();

		//Define the redirections
		switch($this->getLayout() .'.'. $this->getTask())
		{
		case 'extension.custom':
                // here you have to write the redirection (wich view?) in order to load the datas and display the layout ...
				$this->applyRedirection($result, array(
					'stay',
					'com_mycomponent.myview.default'
				), array(
					'cid[]' => null
				));
				break;

			default:
				$this->applyRedirection($result, array(
					'stay',
					'stay'
				));
				break;
		}
	}

Please Log in or Create an account to join the conversation.

Last edit: by liubov.
  • Page:
  • 1
Time to create page: 0.060 seconds
  I still don't believe he can really be human to do all this ! From all of the forums that I've ever participated in this is certainly the one that most encapsulates the feeling of being truly open source where everyone's opinions and contributions can and will shape the development of the service! It's truly awesome! Hope you enjoy cooking and look forward to reading and contributing to any of the editorial work that you proposed too!! Thanks
Gez (audibleid - JED)

Get Started