joomla-component

Tutorial code is not working any more in Joomla 2.5

淺唱寂寞╮ 提交于 2020-01-23 03:32:25
问题 I followed a tutorial from the Joomla developer wiki (http://docs.joomla.org/Developers#Developing_a_Model-View-Controller_.28MVC.29_Component_2) to create a Joomla component. It all worked fine in Joomla 1.7, but when I upgraded to Joomla 2.5 the checkboxes in the backend are not working any more. I checked the code from http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.7_-_Part_09#Adding_a_toolbar in Joomla 2.5 extensions and the boxchecked hidden field

How to use multiple models in joomla MVC Component

做~自己de王妃 提交于 2019-12-29 06:29:28
问题 I am using different model in joomla than view's own model that is similar to its name by assigning it from controller, like: $view->setModel($this->getModel('user')); Now how can I use its method getSingleUser($user_id) in view. In an example in joomla documentation , it is using is some thing like this: $this->get("data1","model2"); So I assume data1 is name of method in model2? If so then how can I pass argument that is userid in my case. I know this is easy thing that many of joomla

How to use multiple models in joomla MVC Component

孤者浪人 提交于 2019-12-29 06:29:07
问题 I am using different model in joomla than view's own model that is similar to its name by assigning it from controller, like: $view->setModel($this->getModel('user')); Now how can I use its method getSingleUser($user_id) in view. In an example in joomla documentation , it is using is some thing like this: $this->get("data1","model2"); So I assume data1 is name of method in model2? If so then how can I pass argument that is userid in my case. I know this is easy thing that many of joomla

joomla i am bussy making mij own rating system

馋奶兔 提交于 2019-12-20 07:49:12
问题 hello im bussy making my own rating system bud i dont know how i get a to mij model can some one help me this mij code controller/beer.php <?php defined('_JEXEC') or die; class BierapiControllerBeer extends JControllerLegacy { function save() { JRequest::checkToken() or die ('verkeerde token'); $date = $this->input->post_ > get('jform', array(), ' array'); $model = $this->getModel(); if ($model->save($date)) { $this->setMessage('save succes'); } else { JError::raiseWarning('', 'save gevaald/>

How to install component and route plugin in one package?

半世苍凉 提交于 2019-12-18 09:06:46
问题 I have created custom component and a route plugin for Joomla 1.5 to to provide SEO URLs for my component and also articles and categories which are not menu tied. Now I have to install my component and route plugin separately. Is there a way to install both in one package please? Thank you in advance! Vojtech 回答1: When any extension installed Joomla triggers an event 'com_yourcomponent_install()' to your install file, which you have mentioned in xml file. write a function com_yourcomponent

Joomla 2.5 -Adding sortable columns to a table in a component

試著忘記壹切 提交于 2019-12-12 02:53:57
问题 I'm coding my own joomla component based on Joomla 2.5.13 and I'm struggling with the "Adding sortable columns" tutorial. Extending the MVC-model with the provided code-snippets from this tutorial does not lead to the expected result, the columns cannot be sorted. I guess, the problem is related to Step 2 (Adapting the View) of the guideline. (Shouldn't this piece of code located in the default.php of the view?) Amending the existing code of the view with the mentioned code snippet causes an

Joomla component how to avoid refilling the password field

霸气de小男生 提交于 2019-12-11 14:06:10
问题 protected function postSaveHook(JModel &$model, $validData = array()) { // Get a handle to the Joomla! application object $application = JFactory::getApplication(); $date = date('Y-m-d H:i:s'); if($validData['date_created'] == '0000-00-00 00:00:00'){ $data['date_created'] = $date; } $data['date_modified'] = $date; $user = JFactory::getUser(); if($validData['user_created'] == 0){ $data['user_created'] = $user->id; } $data['user_modified'] = $user->id; //$password = md5($this->form->getValue(

Joomla: Write and call a helper function in a component

*爱你&永不变心* 提交于 2019-12-11 03:12:45
问题 Fledgling Joomla / PHP developer, hitting a wall understanding how to do this. Everything I found searching has been for older versions of Joomla or other frameworks and so it's all confusing the first time around. I want to have a helper function that I can call from anywhere in my component. Basically it takes a userID input and returns their full name, let's say hair color and height. Here's the function: function get_profile_info($userID) { $db =& JFactory::getDBO(); $query = $db-

How to create custom User Group programmatically in Joomla 3.x?

谁都会走 提交于 2019-12-06 13:11:57
问题 I am writing a custom Component in Joomla 3.x. At a certain point of the component I need to create a Custom User Group under 'Registered' group in Joomla. After searching the web a lot, I found no solution of this problem. 回答1: You can add it to the #__usergroups table programmatically, ensuring the user group is not there already; or get an instance of JTableUsergroup (declared in libraries/joomla/table/usergroup.php ). Since it extends JTable you can use its save() method, passing an array

How to create custom User Group programmatically in Joomla 3.x?

亡梦爱人 提交于 2019-12-04 20:56:32
I am writing a custom Component in Joomla 3.x. At a certain point of the component I need to create a Custom User Group under 'Registered' group in Joomla. After searching the web a lot, I found no solution of this problem. You can add it to the #__usergroups table programmatically, ensuring the user group is not there already; or get an instance of JTableUsergroup (declared in libraries/joomla/table/usergroup.php ). Since it extends JTable you can use its save() method, passing an array with the values you wish to store. Then in order to have proper lft and rgt values, you need to invoke the