Questions tagged [mvc]

MVC stands for Model-View-Controller. It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user.

Filter by
Sorted by
Tagged with
1 vote
0 answers
41 views

Joomla 4 not unzipping custom component update package

I have developed a custom Joomla 4 component called "com_news" and successfully implemented the update functionality before. However, now I am encountering an issue where Joomla can't unzip ...
DeesreX's user avatar
  • 87
1 vote
2 answers
89 views

Joomla 4 API MVC Layer type

Is it possible to create a webservice and API access for my own component if the component file structure is not setup like this and uses namespace based classes? https://docs.joomla.org/J4.x:...
maidan's user avatar
  • 383
1 vote
1 answer
387 views

Joomla correct way of routing

This is in my Controller. Currently, I am redirecting using the inherited function setRedirect(URL_TO_REDIRECT_TO). public function redirectTo($layout){ $this->setRedirect('index.php?option=...
DeesreX's user avatar
  • 87
1 vote
1 answer
159 views

I want to display a form with the data added already

public function getLaymanLayout($id){ $form = $this->getForm(); $form->bind(0); } I still have a lot to implement and make it correct to the MVC rules. I want to call a table from the ...
DeesreX's user avatar
  • 87
1 vote
0 answers
25 views

Getting allready created component model instance in a module (singleton)

I have a module, that does some stuff and needs the data from the list model of my component. Everything is coded in MVC pattern using the Joomla framework. When clicking on a menu item the list model ...
maidan's user avatar
  • 383
1 vote
1 answer
283 views

View only showing one row from sql result set

I am creating a component and trying to display a list within a model. The code I have shows the multiple arrays that should be on the list, but when I add echo inside the view table, I am only ...
Brandon's user avatar
  • 69
1 vote
1 answer
112 views

Sharing a MVC resources library between two components

Lets say my component is called dumbo. It contains all kind of MVC stuff and works well. Now i have a second component that is called jumbo. I need both components to share some models, controllers ...
Mike's user avatar
  • 341
0 votes
0 answers
47 views

Can I load my controller, model and view directly from the plugin?

I am trying to create a plugin that adds a new view to my component (addon). Can I load my controller, model and view directly from the plugin? For example: require_once("/pludins/myplugintype/...
MaXX's user avatar
  • 171
1 vote
1 answer
104 views

Toolbar not displayed in my Joomla MVC component

view.html.php class gezcViewVliegtuigen extends JViewLegacy { protected $editID = 0; // if task is not specifiek in the url als parameter, display will be used function display($tpl = ...
user3412673's user avatar
1 vote
0 answers
160 views

Embed custom JS app in Joomla MVC

A before warning: I'm new to both Joomla, PHP and JS. So this might be obvious, but I'm lost. I'm looking to embed a program I made in react/node into Joomla. The program uses JSX to create the HTML ...
miasto's user avatar
  • 11
2 votes
0 answers
157 views

How to get an AJAX call in component's administrator side

I added a component to my site and it accesses my DB via an AJAX call. In my 'tmpl' folder, I have a 'default.php' file which makes an AJAX call that is received by view.json.php just outside that ...
LaioZatt's user avatar
0 votes
1 answer
464 views

Display the component view or layout into a module

I've built my own component com_mycomp and in the component there is form in a layout and the path to this layout is: com_mycomp/site/layouts/subscription/form.php so I want to show this layout (form)...
TrolliFlame's user avatar
0 votes
1 answer
185 views

Create a User Area

I'm wondering how i can create a User Area for users to login and gain access to a user panel (where user can update their info and specfic/custom actions). Because the Joomla user login ...
Thiago Guimarães's user avatar
1 vote
2 answers
341 views

How can I show an alternate layout for my view in an MVC component?

I am trying to choose the layout for my view dynamically, which is what I imagined setLayout or loadTemplate on my JViewLegacy view would be able to do, but there seems to be some extra convention ...
glenatron's user avatar
  • 239
0 votes
1 answer
357 views

Retrieve the value of a line a checkbox

I'm blocking on retrieving an item from a data list. My code: <div id="contenu2" class="content"> <div> <form action="" method="post" id="adminForm" name="adminForm"> <table ...
user14167's user avatar
1 vote
2 answers
587 views

How to set the view location in Joomla 4

I'm rebuilding a component called DogWalk for Joomla 4 and I've tried to ensure I'm doing exactly what the core Banners component does. I've named and namespaced my files, named my directories ...
user101289's user avatar
  • 1,119
2 votes
1 answer
219 views

Sharing a model between two views in a component

I have one model I'd like to use for two different views. This is the only model these two views will require. I'm subclassing Joomla\CMS\MVC\Controller\BaseController and I'd like to use its display ...
Dom's user avatar
  • 512
1 vote
0 answers
578 views

JModelAdmin - save() method. What's the purpose of $table->newTags?

Can someone explain me why in the save method of the AdminModel class, there is the creation of a new $newTags property on the $table? How this new property is used? How is it handled later on by the ...
FFrewin's user avatar
  • 19.6k
0 votes
1 answer
704 views

Calling a Model's Method from View [duplicate]

I have a function in my model to sum several columns of a table. public static function get_sums() { // Create a new query object. $db = $this->getDbo(); $query = $...
Steve C.'s user avatar
2 votes
1 answer
619 views

Documentation tutorial: Why is my JFormFieldList showing a textbox?

I was going through this part of the tutorial: https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Using_the_database Except I tried using my own names instead of 'helloworld'. Everything else ...
Glitch's user avatar
  • 287
1 vote
1 answer
647 views

Get user id from user form field type

I have a custom database table created with my component that has a user id linked by foreign key to #__usersand I have a form field type in Joomla 3.x mvc <field name="modified_user_id" type="...
Nederealm's user avatar
  • 113
2 votes
1 answer
200 views

How can I create a custom attribute/property on a model?

In my custom component, I'm currently stuck with Joomla's way of handling model custom properties. Let's say I have a model Property. To know if this Property is sold, I have to run a query on ...
thomas_inckx's user avatar
1 vote
1 answer
61 views

joomla mvc tutorial editing component issue

I have gone through the steps provided here: https://docs.joomla.org/J3.x:Developing_an_MVC_Component I am currently on https://docs.joomla.org/J3.x:Developing_an_MVC_Component/...
onLoad's user avatar
  • 48
5 votes
1 answer
1k views

Joomla Terminology: view, layout, task and component development

I'm a developer and I am very confident with MVC patterns and have already developed a lot of web apps from scratch using PHP frameworks like symfony and yii. However, I'm a little bit confused about ...
user2548436's user avatar
5 votes
1 answer
543 views

Why does Joomla have both models and tables?

In classic MVC, you have models that loosely corresponds to the underlying database tables. Why would Joomla need both models and tables? Edit Some quotes from provided links: In summary, the model ...
Olle Härstedt's user avatar
0 votes
1 answer
218 views

Restricted direct access creates problems passing references between files

Context (Long Story Short): I am using a PHP script and the $_POST variable to handle certain ajax POST requests from a view template. It needs access to database connector classes which can be ...
Patrick Noble's user avatar
2 votes
2 answers
142 views

Natively override core extension classes from templates?

Is there any way to do this natively yet (ie. without using a plugin)? I'm hoping there's native support similar to the way the old MVC Override plugin allowed class overrides using a /code folder in ...
Bathmat's user avatar
  • 492
2 votes
1 answer
263 views

Where to prevent field value change in custom component form record?

Where is the best place in Joomla MVC (server-side) to forbid users from changing a value in a pre-existing form record? In JTable check / bind/ JModel prepareTable, or elsewhere? For context, I have ...
codinghands's user avatar
  • 2,295
0 votes
1 answer
325 views

Can a model display itself within the view of a different model?

This isn't a question about getting model data into another view. I can create a huge form with data from multiple models. But, is that necessary? Can a model display its view within the context of ...
nimble's user avatar
  • 418
2 votes
1 answer
297 views

Create record from modal edit form

Is there a standard Joomla mechanism / development pattern for creating a modal edit form to create an item from within another item? I've used this tutorial to create a modal list view, where you ...
codinghands's user avatar
  • 2,295
2 votes
2 answers
3k views

How to render a component view in a module?

Brief I have a component and have a form in it. And I want to render the same form in a module. An example can be core Joomla article edit form components/com_content/views/form/tmpl/edit.php which ...
AHeavyObject's user avatar
0 votes
1 answer
135 views

Joomla component development - how to organize?

I am trying to write simple component for Joomla 3 to show catalogue and products. I did made my model catalogue and it works ok - it shows list of all products with pagination, but I also want to ...
LMCho's user avatar
  • 1
1 vote
1 answer
75 views

What is the proper way to handle models that use other models in MVC?

I'm developing my first component and I'm not sure how to best handle models that use other models from a design and implementation standpoint. For instance, I have a contact model (person or business)...
nimble's user avatar
  • 418
1 vote
1 answer
163 views

which exception should be thrown when sanity checks fail?

Which SPL exception should be thrown when sanity checks fail? For example, if the check() function fails when saving data with JTable or a parameter check fails? I'd prefer to use something more ...
nimble's user avatar
  • 418
2 votes
1 answer
301 views

How to use look-up tables in a custom component?

I'm trying to develop my first component in Joomla 3.x. I'm new to the MVC paradigm and learning the basics of Joomla development. To start, I'm trying to develop a simple component to add and ...
nimble's user avatar
  • 418
1 vote
2 answers
702 views

how to rename file on upload custom component joomla 3

I recently create a custom component with Component Creator, and I have a form in admin area that uploads file... But I can't upload files with same name it's going to replace the previous file, now ...
Arash Yazdani's user avatar
2 votes
1 answer
1k views

Model / View pulling data from external API(s)

I have a model pulling data from two external API's, concatenating the returned arrays, and a view template that displays it. I have a sub-view that will need only one of the API's. So my question ...
James's user avatar
  • 642
2 votes
1 answer
171 views

The safety of direct SQL-requests in Joomla templates/views

I need to change the ordering of which the products are displayed on the Virtuemart category page. The files models/product.php and tables/products.php are too complicated for me to put the changes in ...
stckvrw's user avatar
  • 891
2 votes
2 answers
173 views

MVC: Include classes in a component

So, for example, I have 3 classes: Division, Employee, Task. Every task has an employee assigned to it and every employee belongs to a division. Currently I need 4 views: a list of tasks assigned to ...
Arter Cadelanne's user avatar
6 votes
2 answers
149 views

Joomla Component Development: Starting Point

So, basically, I've developed an application that gets the data from the database, processes it and then displays it on a webpage and now I need to integrate it with joomla. I've read about MVC ...
Arter Cadelanne's user avatar
2 votes
1 answer
1k views

How to call Users controller's method from any custom component with argument?

Can any one suggest how I can call the Users default controller's methods, like activate or any other, that I have created in User controller of Admin site with argument?
Rushabh Madhu's user avatar
2 votes
2 answers
1k views

Fatal error: Cannot redeclare class ContentModelArticles

I tried to edit some of the core files in Joomla. Im using MVC override plugin:enter link description here I want to override article.php and articles.php in components/com_content/models. The ...
Peter's user avatar
  • 325
7 votes
2 answers
2k views

What does the view.html.php and default.php file do in the view section?

I'm sure this sounds like a silly question but I am new to the MVC framework with Joomla and I haven't found any documentation that gives a clear definition. All I know so far is that the view.html....
Isaac's user avatar
  • 71
2 votes
1 answer
84 views

Where to process data in MVC

This may be a very basic question but i am new to this and all the tutorials i watched don't work with processing data before displaying. I am working on a Administration Component thet is supposed to ...
LocalHorst's user avatar
5 votes
1 answer
4k views

Click on custom button opens modal window

I've got some custom buttons in my Joomla component and I want them to open in a modal window like with the batch button in the com_content component. Anyone has got any idea on how to do it? Thank ...
republicca's user avatar
3 votes
2 answers
761 views

Joomla AJAX request

I'm developing a Joomla component where I have a treeview in the sidebar with the content of a database table. When clicking a node of this sidebar I want to show the children nodes in the main part ...
republicca's user avatar
0 votes
1 answer
80 views

The best way of storing products and categories in own component

I'm creating my own shopping cart component and I can't choose what way of storing products and categories would be the best. There are the following few options: 1. A fully independent component ...
stckvrw's user avatar
  • 891
4 votes
3 answers
3k views

Multiple controllers in Joomla

I am totally Joomla noob and trying to figure out how to control MVC in Joomla. I've read this "Developing a MVC Component" in Joomla basic tutorial and understand that the main controller is ...
SonDang's user avatar
  • 163
3 votes
1 answer
678 views

MVC component JForm data array to string conversion before save()

I have an admin form with a multiselect form field. Hitting save is passing this as an array and I would like to convert these array values to a comma delimited string before saving to the database. ...
dustin's user avatar
  • 107
1 vote
3 answers
270 views

MVC component language file not overriding '_N_ITEMS_DELETED' string

I have a feeling this has an extremely simple solution that I am overlooking... My component has a language file which does some string replacements (surprise, surprise). Most seem to be working, but ...
dustin's user avatar
  • 107