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.053 seconds

The j-cook project is one of the best of its kind and it is nice that we all try to contribute in little ways to make life easy for each other.

vlemos (Forum)  

Get Started