I have admin module (modules/admin) with controller admin (modules/admin/admin).
I need put new controllers of admin to Codeigniter controllers folder (application/controllers/admin/new_controller), but when i go to site.com/admin/new_controller – 404. Why I need it? I want to admin module was every customer the same, but the other controllers must be unique for each project, thats why I need to put new controllers to application/controllers/admin/ folder.
Is it possible to do this?
Codeigniter 3 and Wiredezignz HMVC (https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc)
Ok, I don't know if it's the right decision, but I change name of folder: application/controllers/admin to admin_unique
and add to application/configs/routes.php two lines, example:
$route['admin/(login|logout|index|settings|users)'] = 'admin/admin/$1';
$route['admin/(.*)'] = 'admin_unique/$1';
Related
I understand the ability to overide core views in Joomla using overides, but how about the models and controllers? I would like the ability to add a field to the core user registration form, but Joomla pulls all the fields from an xml located in the models folder. I could just create a plugin, but that creates its own section, and I need it to go exclusively in the main registration form, as I am creating a tiered registration.
My question is exactly how the title implies, can you create component overrides of model and controller files in joomla, rather than just views?
Further, I know I "could", but in the event of an update I want to make sure this is an acceptable override solution - not just a hack that will be subject to be overwritten.
Thanks!!
Yes it can, i used MVC Override 1.0.11, is Joomla 3.x compatible.
in my case i used to override /models from component com_tag
structure in your template in this form:
/code/YOUR_COMPONENT/models/tag.php
above is my example
and you can do override correctly. the link is:
http://gruz.org.ua/en/extensions/joomla-mvc-override/1_0_11.html
I have just started to work on laravel 4. I need to make differentiate the admin and fornt.
Like AdminController.php and FrontController.php in codeigniter. Is it possible in laravel4 or any other technique?
Thanks
You could create separate controllers, or you could create a different bundle/package for each
see the docs http://laravel.com/docs/packages
I am building a Laravel 4 application and I am trying to sort out where my admin controller functions should go.
eg my admin user view, edit and update functions.
Previously in my User controller, I would have
function getIndex()
{
// Get method for normal users
}
function getAdminIndex()
{
// Get method for admin users
}
I would then have in the routes /users -> getIndex() and /admin/users -> getAdminIndex()
however, is this ideal?
The reason is it makes my routes file quite large as I have to specify every route.
With things like Blog posts, and Products, should I have one controller for logged out / user access, and then a separate controller, in an admin folder for just the admin functions?
Is there some open source projects I can look at?
You should separate your regular controllers from your admin controllers. It's a matter of personal preference how you do it: you can create folders inside your controllers folder, or maybe you could create –almost– independent modules with controllers on their own.
For the first option, take a look at this project:
https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site
For the second one, which is a bit more complex, you can get inspired from this post by Ryan Tablada:
http://ryantablada.com/post/juggling-larger-laravel-applications
I personally prefer this last one if the project is medium/large size, and the other one if it's a small project.
You can also try Laravella, a CMS, CRUD, Bootstrap, Uploader etc. framework for Laravel.
https://github.com/laravella/laravella/releases
If your project is small, then you can use Resource Controller.
I have some basic controllers and admin controllers, I'm trying to separate them in folder to avoid things like this one:
controllers/user.php -> general users
controllers/a_user.php -> for admin users
I've read some things about route but couldn't find a way to do that.
Thanks in advance for any help.
Create a subfolder inside controllers folder and place your admin controllers in there.
I created one application in codeigniter. But Now I want to move that to admin side. I have read 3 methods from http://philsturgeon.co.uk/blog/2009/07/Create-an-Admin-panel-with-CodeIgniter. Here I decided to use second one.
I that I created an admin folder in controller, admin folder in views,admin folder in css, and an admin folder in js to store the files like admin side controller, admin side views , admin css and admin js. I have set $route['admin']='application/admin';
And my question is:
When I access the file http:example.com/admin I am getting the page without js and css. How to solve that.
And one more question:
$this->load->views('add_user'). This statement changed to $this->load->views('admin/add_user')
Its difficult to change each and every page.
You can share models and libraries between applications by using CI 2 "Packages". Have a look in the Loader documentation to see how that works.