Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
72 views

How to create a Joomla MVC for consuming a RESTful API

I'm looking for some help with writing a Joomla MVC which will consume a RESTful API. The API returns data in JSON and XML. The component should have two views (a frontend list with all objects - ...
1
vote
0answers
254 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 ...
0
votes
1answer
131 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 = $...
2
votes
1answer
211 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 ...
1
vote
1answer
232 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="...
2
votes
1answer
111 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 ...
1
vote
1answer
48 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/...
6
votes
1answer
490 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 ...
6
votes
1answer
254 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 ...
0
votes
1answer
72 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 ...
2
votes
2answers
88 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 ...
2
votes
1answer
158 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 ...
0
votes
1answer
229 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 ...
2
votes
1answer
176 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 ...
1
vote
2answers
1k 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 ...
0
votes
1answer
114 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 ...
1
vote
1answer
59 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)...
1
vote
1answer
56 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 ...
2
votes
1answer
173 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 ...
0
votes
2answers
362 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 ...
2
votes
1answer
646 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 ...
2
votes
1answer
126 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 ...
2
votes
2answers
110 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 ...
6
votes
2answers
132 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 ...
2
votes
1answer
624 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?
2
votes
2answers
720 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 ...
6
votes
2answers
1k 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....
2
votes
1answer
73 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 ...
4
votes
1answer
3k 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 ...
3
votes
2answers
420 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 ...
0
votes
1answer
60 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 ...
3
votes
3answers
2k 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 ...
3
votes
1answer
576 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. ...
1
vote
3answers
179 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 ...
1
vote
0answers
84 views

How to retain state on refresh when adding a new item?

In a component I'm building I plan on having a 'new item' screen featuring a button that will, on click, allow a modal selection from a 'list' view using a custom modal form field type. Once done, I'...
2
votes
2answers
352 views

How about storing single records and their categories in one table

I'm developing my own component for Joomla. I know that in many components single records and their categories are stored in different tables of the database. But how about storing them in ONE table ...
1
vote
1answer
70 views

Where to add M-N linking records after a another record is saved?

In my component, I have 3 tables, 2 object tables (Course and Module), and 1 linking table (Course_Modules). In my edit form for courses I have a multi-select allowing users to pick 1 or more modules ...
1
vote
1answer
92 views

How can I include additional models in a subcontroller?

So I have a subcontroller extending JControllerForm that handles the edit view of an item in my component. As part of this I'd like to render some associated items, which come from a different DB ...
3
votes
2answers
1k views

Pre-processing form data before display / save - what's the standard approach?

I'm developing a new Joomla component where I have a JAdminForm called course.xml. This form has several text fields / text areas that will contain meta titles / tags for an item. However, when ...
2
votes
2answers
864 views

Edit a record saves a new record with updated fields

I'm writing a small Joomla component for my school but there is a little problem with it. When I go to edit a record and then save it, instead of updating that record, it saves it as a new record ...
3
votes
1answer
842 views

Joomla 3.4 Development File Handling

I am making a basic MVC component, mostly following the HelloWorld tutorial. I made a form which contains a upload button and an input of type "file". The form loads fine, but when I upload a file I ...
0
votes
1answer
360 views

Joomla MVC Component: Run SQL before deleting record

I have a course listing component, and each course as zero, one, or more corresponding sections for that course. Basically different versions of that course that run at different times at different ...
0
votes
1answer
231 views

MVC Component Admin Menu Item Language Strings Not Appearing

I am building a component in Joomla 3.3 to list courses and their respective sections, and provide an administrative interface in the back-end. After my component is installed, or if I navigate to ...
1
vote
1answer
55 views

Sharing Joomla views across extensions

I created my own Joomla Library which holds a few utility functions and some views which should be shared with other extensions that need the same views. Inside one extensions ("Redextension") view ...
1
vote
1answer
298 views

Cannot redeclare class error with System Override plugin

I'm creating a Core override plugin(for overriding the 3r party extension) using Joomla system plugin. The issue is Cannot redeclare class VirtueMartCart error showing on t3 framework based template. ...
1
vote
1answer
831 views

Backend Delete button, doest parse the cid[] array that contains the id of checked, checkboxes

In the admin section of a component, i have this form: I just added the checkboxes in the left following this Joomla API. MyCode: $i=$rows_num; $checked = JHTML::_( 'grid.id', $i, $voter["vid"] )...
2
votes
1answer
999 views

Joomla 3: display view with toolbar in modal

I'm developing an MVC component for Joomla 3.x with currently 3 views: VIEWS |-PAGES (displays all pages in a list, ordinary joomla view) |-view.html.php |-TMPL |-default.php |-PAGE (forms ...
11
votes
1answer
2k views

How can I use Joomla's Cache with my components view?

As is typically the case with a CMS, the most hits occur while it is still "new". I'd like to cache the page output the first time it is rendered for a given period as to reduce the heavy workload ...
2
votes
1answer
679 views

Refreshing a part of the page after Dropdown list selection

How can I refresh a part of the page when I select from a dropdown list using the onchange in HTML? I have a Reports dropdown list. Once I select a Report, a list refreshes only displaying those that ...
5
votes
2answers
2k views

Joomla MVC Component File upload w/ Database field update

So I find this a little weird because the DB field was updating without much effort on my part, until I started writing in file upload functionality. Now the database doesn't seem to be updating, but ...