7
votes
Accepted
Joomla Terminology: view, layout, task and component development
Running ahead a little bit let me provide you with link to JooYii Library. This library makes a leap ahead brings some practices that would be at Joomla! 4 to current Joomla! 3.x branch along with ...
3
votes
Accepted
How does Joomla Generate a Page When the View is Excluded?
Displaying a view is really executing display task of the main controller. Therefore, view parameter is only specific to display task, it is not used by other controllers/tasks. Core components are ...
3
votes
Accepted
Documentation tutorial: Why is my JFormFieldList showing a textbox?
The problem is that it is not able to get the field. I see filename you have defined as ulwiz_wmode.php and in class name you are using this JFormFieldUlWiz_WMode. Make sure the naming convention is ...
3
votes
Accepted
Toolbar not displayed in my Joomla MVC component
Toolbar isn't really supported in frontend. In backend it's rendered by mod_toolbar module which is only available in backend.
You can still render the toolbar in frontend using this code but it may ...
3
votes
Accepted
Joomla correct way of routing
You should run the URL through Joomla\CMS\Router\Route::_() before passing to setRedirect() to get the correct SEF URL since none of the involved methods do that automatically.
use Joomla\CMS\Router\...
3
votes
Accepted
Why does Joomla have both models and tables?
Class JTable is created to work strictly on database object. Table object should create,modify,delete,check data in database. It can be used in many models, helpers, modules. Single model some times ...
2
votes
How can I can get the new record ID after saving data with JModel?
Even though this is an old post. I wanted to post one of the solutions that helped me.
JLoader::import('group', JPATH_ADMINISTRATOR.'/components/com_users/models');
$groupModel = JModelLegacy::...
2
votes
Create a User Area
Two questions:
Do you want your users log in front or backend of your site?
The workflow is a little different for each scenario.
What user functionality you want?, or want to extend?, once the user ...
2
votes
Accepted
View only showing one row from sql result set
The good news is that this is a very basic task.
I would pass the entire players result set to your view via $this->_item->players.
$query
->select("*")
->from($db->qn(...
2
votes
Sharing a model between two views in a component
OK, comments are not the easiest place to talk in details (too short, too easy to misinterpret) so I'll post this here. It may be a bit wide-ranging and high-concept at first b/c of the lack of detail ...
2
votes
For how long will legacy component MVC structure work in Joomla?
My understanding is I don't believe it will 'stop working'. The new structure is guideline or preferred structure that brings Joomla inline with other frameworks. You can have whatever structure you ...
2
votes
Joomla 4 API MVC Layer type
You can use virtually any component structure you want as long as Joomla can dispatch the component. You can use the J3 style single entry file. You can use the J4 service provider while still using ...
1
vote
For how long will legacy component MVC structure work in Joomla?
According to information from volunteers over at the Joomla Mattermost community, the most up-to-date information is the one found in code comments. I received this link to Joomla's code that ...
1
vote
Accepted
I want to display a form with the data added already
There is a method $form->setProperty() which does this.
1
vote
Sharing a MVC resources library between two components
First of all, you're using different file structure and class naming conventions than Joomla! core. This won't work without rewriting related methods such as controller's getView().
That said, using ...
1
vote
Display the component view or layout into a module
I would program a custom module for this purpose.
In its helper file I would load the Model of your component to retrieve the items that you will display.
Check out a Joomla core module like /...
1
vote
Accepted
Get user id from user form field type
Here is the code you would put in your models/forms XML file:
<field
name="modified_user_id"
type="sql"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
description="...
1
vote
How can I create a custom attribute/property on a model?
Table
You can modify a Table object (usualy in /administrator/com_yourcomponent/tables/property.php) of this Property to set the is_sold property in load method right after parent::load().
Model
Other ...
1
vote
How can I show an alternate layout for my view in an MVC component?
I have been fighting the same problem for two full days now, going over lesson 10 of Robbie Jacksons excellent video explanations in this series https://docs.joomla.org/J3.x:...
1
vote
Accepted
How can I show an alternate layout for my view in an MVC component?
The approach given above seemed like it should work because it does. However, if your class is a little more complex than my example and you have a __construct() function don't forget to call parent::...
1
vote
Retrieve the value of a line a checkbox
Yes, the ids of those records that have been checked will be sent in the HTTP POST request within a param array named cid. You can retrieve them via $_REQUEST['cid'], but it's safer to retrieve them ...
1
vote
How to set the view location in Joomla 4
The view file that your component is looking for MycomponentViewViewname which was used in the Joomla 3, so make sure you are extending the right controller class in your Controller(i.e Joomla\CMS\MVC\...
1
vote
Edit a record saves a new record with updated fields
In the view of your component.
components->com_mycom->view->tmpl->default.php (or edit.php, some.php) depending on your needs.
<form action="<?php echo JRoute::_( 'index.php?option=com_student&...
1
vote
How to query and display a list of nested tags for a particular parent on front end as links?
<?php
defined('_JEXEC') or die; // Joomla
$parent_tag_id=12345; // your tag id here
JLoader::register('TagsHelperRoute', JPATH_BASE . '/components/com_tags/helpers/route.php');
$tags_tree=JTable::...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mvc × 87joomla-3.x × 42
component × 36
development × 19
custom-component × 14
model × 10
php × 8
joomla-2.5 × 6
joomla-api × 6
database × 5
joomla-4.x × 5
view × 5
jtable × 4
plugin × 3
mysql × 3
overrides × 3
ajax × 3
fix-my-code × 3
modal × 3
joomla-3.3.x × 2
joomla-3.6 × 2
jform × 2
form-fields-types × 2
file-upload × 2
jinput × 2