Welcome Guest, Not a member yet? Register   Sign In
Admin module


I trying to create an admin module. So I have created the follow structure.

index.php (whit class extends CI_Controller and method index())

I trying modify my routes.php to access it, like localhost/site/admin
In my routes.php file, I wrote if $route['admin'] = "modules/admin/index/index"; but didn't work.


Do you have @wiredesignz' HMVC installed? If not, you will have to get that one first Wink

Otherwise, make your route

$route['admin'] = 'admin/index/index'; # module/controller/method

since you don't need the 'modules' within the routes. It will automatically be handled correctly by the Loader from HMVC.

PhilTem, I only have a default structure from CI.

I realy need use the HMVC?

[quote author="Cálcio" date="1330018755"]PhilTem, I only have a default structure from CI.

I realy need use the HMVC? [/quote]

If you would like each controller/models/views for a page to be separated for a clean folder structure than yes. The /application/modules only works if you are using HMVC from wiredesignz. One advantage to using HMVC, is you may find there are some controllers/views you would like to reuse on another project. If they are bundled into their modules folder, you can easily copy and paste into a new project.

Well, as @pickupman mentioned, you don't NEED HMVC, but if you want to have your site a little more structured (and have code easily reusable) then HMVC will be the right thing for you.

Otherwise, to get your admin-controller working, you have to put it into ./application/controllers with whatever name you prefer.
Before using HMVC, I had a folder admin within the controllers folder where I put all admin-controllers. That way you have basic/public controllers separated from admin-controllers very easily. Just put a controller called index inside the admin-folder and it will handle the default actions when www.example.com/admin is called.

Thanks, I will try do it. Yesterday I got it. But I cant try "install" it.

Sometimes I ask. Why these framework like CI, Cake, Yii and orthers didn't worry about this implementation like Admin Area. They have pagination, Auto CRUD, Others "Helpers" and "libraries" but do not think about it. Nowadays 99% websites needs a beck-end area, Nowadays it is very basic like pagination.

No, we need find a miracle way to do it. lol

[eluser]Mauricio de Abreu Antunes[/eluser]
You can share your libs on github. :-)
Lemme know if you need help in this project. hehehe x)

Mauricio, Eu só estou estudando o CI e tendando montar uma apostila mas pretendo abordar o assunto com um case real. Frazer um blog com post e delete ñ tem nada de mundo real. No mundo real as cosias são diferentes, tem integração com jQuery, AJAX, "Templates/layout" e principalmente uma área administrativa para quem mantem o site. Isso já deveria vir na estrutua padrão desses frameworks.

Mauricio, I'm only study it. I'm trying do a book with real cases. Make a blog with input and delete it is not real. On real world it is very different has integration with jQuery, Ajax, "Templates/layout" and mainly back-end area who will maintain the website. This should come as default struct in these frameworks.

Yesterday I found a book for CI, but I couldn't donlwoad.

[eluser]Mauricio de Abreu Antunes[/eluser]
Pois é, eu comecei com CI agora, mas já tinha idéia de outros frameworks em outras tecnologias (Java, .NET).
Então, eu acho que o framework só oferece suporte para que você consiga construir essa área de admin, por exemplo, de uma forma mais rápida e padrão.

Indeed, i started with CI now, but i had knowledge about other frameworks (like Java and .NET).
So...i think the framework just offers suport for you build your own admin area a faster way and standard.


Mauricio vc já usou esse HMVC? pode me dar uma dica ou algum link em pt?


Mauricio, have you ever use this HMVC? Can you give me a help o some link on pt?

Theme © iAndrew 2016 - Forum software by © MyBB