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 [controller]

The tag has no usage guidance.

0
votes
0answers
92 views

How to redirect a different url using Controller page

After submitting a form, the page refresh with a thank you message. So how can I redirect that page to a different url after successfully submitting the form. Current Form codes are as following: &...
0
votes
1answer
24 views

Is it possible to check if a method or function exists in the component controller?

I have a custom component that will be using various AJAX calls, based on outside settings. How can I load "this" controller from the View or Model to determine if a method/function exists, i.e. PHP ...
1
vote
1answer
36 views

How can I have a dynamic $default_view?

Something along the lines of: JLoader::Register('MyComHelperConfig', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/config.php'); class MyComController extends JControllerLegacy { protected $...
3
votes
2answers
1k views

Pass results (array) from controller into view and show it

I'm experimenting with creating my own Joomla component. The component searches records in database tables, but I have a problem with how to show them. I have a search form that sends the search ...
0
votes
1answer
382 views

What controller does front end form data post to using a component

I have been using Joomla for the last couple weeks and it seems straightforward so far and I understand the code in examples. I've successfully created a custom module that displays on the front end. ...
1
vote
1answer
59 views

Pass argument to controller methods

Is it possible to pass arguments to controller action methods, like public function someAction($myArgument) { ... } Or is using JInput the only way? Edit: Using a URL like option=com_mycomponent&...
1
vote
1answer
349 views

Override View path in the Controller is only partially working

In my main controller, I'm successfully incorporating a custom path for the Model, but seem to be missing something for the custom path to the View. The component path is: \components \...
1
vote
1answer
710 views

Form-Validation in Frontend

I'm trying to get my component ready for frontend-action. There are some forms that are filled by the user - but of course I have some fields that need specific values (int, float, ...) and some ...
0
votes
0answers
607 views

Model/Controller: get id of current item and use it in controller

I got a view in my component's frontend, which catches data from model using the ID of the element: protected function populateState($ordering = null, $direction = null) { $app = ...
3
votes
2answers
429 views

Custom component: Export items to CSV -> Changing searchbar causes a new download

I would like to export all selected items from the items-view of my component. To do so I modified my view and inserted a new button to the JToolBarHelper::custom('items.exportcsv', 'download', '', ...
1
vote
2answers
311 views

Call Controller's Publish-Method from CLI or Helper

I would like to call the publishing-method I defined in my item's controller from a CLI-script or a helper (which is included in the CLI). The best case would be to call it like this: $...
6
votes
1answer
5k views

Best way to include helper class in sub-controller : require_once or JLoader

I have created a helper file test.php as following: administrator/components/com_compname/helpers/test.php class TestHelper{ //class methods } In controllers/subcontrollername.php We can use ...
0
votes
1answer
119 views

Friendly links to call a controller task

I developed an ecommerce component and I have the following problem that I hope you could help me. The component has a locations manager where we can enlist cities such as: Madrid, London, Paris, ...
2
votes
1answer
26 views

Create Dialog on publishing methods

I would like to create a little dialog on publishing-events on an item of my self-developed component. For example: Item gets published - the item's controller is called and rund method publish with $...
5
votes
3answers
8k views

How to get menu parameters and itemid in component controller

In my custom component controller I have function save(). At the end it displays message and redirects to url $this->setMessage(JText::_('SOME_TEXT')); $this->setRedirect(JRoute::_('index.php?...
1
vote
1answer
32 views

State set to 0 after parent::publish

I'm extending my controller's publishing method for a task called "setup". This is the extended method: /** * publish function. * * @access public * @return void */ public function publish() { ...
3
votes
3answers
1k views

Insert query not working within a loop

I am trying to insert records in a loop. But unable to do so. Following is my code: historical.raw.php : created a task in controller of format raw public function historical() { $db = JFactory::...
1
vote
1answer
527 views

Controller error: Invalid controller: name='dasdada'

I am trying to send information from a to a DB. I am using Jfactory. This is the HTML: <textarea name="task" class="form-control" id="task"></textarea> Variable: $_POST['task'] This ...
1
vote
1answer
626 views

Joomla-Development: Set default view

I would like to set up a default view. If my component gets called by using administrator/index.php?option=com_bestia&view= I'm getting the error: 404 View not found [Name, Typ, Präfix]: bestia,...
3
votes
2answers
407 views

Call controller's publish-function from “outside”

I modified the publish-function of my sub-controller as follows /** * publish function. * * @access public * @return void */ public function publish() { $...
5
votes
1answer
375 views

Extend publishing in controller?

I would like to extend the (un)publish-function in a sub controller. I thought it would be enough to write something like that to my sub controller items.php: public function unpublish() { ...
1
vote
3answers
377 views

Joomla 3.4.3 get fatal error while opening plugins

While trying to open any plugin from Joomla administration, a blank page with this error message displays: Fatal error: Call to a member function getTable() on a non-object in .../libraries/legacy/...
4
votes
2answers
2k views

How to remove component name from URL?

I am making a custom component and I dont want the name of the component on the URL when component loads. The URL is coming like this : http://example.com/component/componentName/view=viewName But ...
3
votes
3answers
600 views

Load controller dynamically just like model

As we can load third party component model like this: Loader::import('joomla.application.component.model'); JLoader::import('modelname', JPATH_ROOT.'/components/com_componentname/models'); $model = ...
4
votes
2answers
2k views

How to override a component's controller

I want to override a controller inside a component ie; File path : components/com_test/controllers/test.php how can I override test.php ?