hmvc

How to load a module outside modules folder on HMVC with CodeIgniter?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 02:19:00
问题 Since I didn't find it anywhere else on the net, I hope I'm not asking a stupid question. So I have this structure on my app: My APP |_ Controllers |_ Modules |_ bar |_ foo |_ Views I can load the bar module on the foo's views using this code: <?php echo Modules::run('bar/bar/index'); ?> But I'm unable to load the same module on MyAPP views using the code above. What am I missing? Thanks! 回答1: Silly me, I was extending CI_Controller instead of MX_Controller on all my controllers outside the

Using Smarty 3, Code Igniter 2, and HMVC together with smarty's inheritance?

夙愿已清 提交于 2019-12-11 15:51:02
问题 I am using Code Igniter, The HMVC library, and Smarty with this library. Smarty is working fine by default, however if I try to use smarty's inheritance feature ( {extends file="master.tpl"} ) then we run into an issue. The extends feature does not look in the module views folder for the extended file (in the above's case master.tpl ), instead it only looks in the application/views/ folder and throws an error if it cannot find it. I could add APPPATH."modules/smartytest/views" to the $config[

Codeigniter HMVC Ajax

折月煮酒 提交于 2019-12-11 01:00:00
问题 I need some help in my issue. I have a list of users and I want to delete user onclick of delete button using ajax in CI HMVC. Here is code of my list view $(function() { $(".tip-del").click(function() { var recId = $(this).data("id"); var parent = $(this).parent(); var BASE_URL = "<?php echo base_url()?>"; var r = confirm("Are you sure you want to delete this user?"); if(r == true){ $.ajax({ url : BASE_URL + 'auth/delete_user', type: 'post', data: {'rec_id' : recId }, success: function

Codeigniter 3 - HMVC ::run() & ::load() problems

泄露秘密 提交于 2019-12-10 23:27:48
问题 I have issues when I try something as basic as, let's say, displaying a login form to a user : I have a Users controller in my module Users that has a function login_form() supposed to display the form. I also have a Controller Admin in my CI folder application/controllers/Admin.php which has a login() function that can call the user module. The problem : If I browse directly users/login_form, it works and calls the login_form() function. But if Admin/login is browsed and calls Users/login

CodeIgniter and HMVC questions

ぃ、小莉子 提交于 2019-12-09 05:59:53
问题 First of all, sorry for any convenience caused by this post because this is the first time I post a question here and I need more time to get used to with this. Q1. I want to create 2 "master controllers" for FrontEnd and BackEnd like this: MY_Controller extends CI_Controller FrontEnd extends MY_Controller and all frontend controllers will extend FrontEnd . BackEnd extends MY_Controller and all backend controllers will extend BackEnd . What's the best way to do that with HMVC (MX)? Thanks

How to implement HMVC structure in Node/Express

倾然丶 夕夏残阳落幕 提交于 2019-12-08 09:52:31
问题 I have several "api" endpoints in my application that are used by the front-end framework for its AJAX processes. For organizational purposes, I would like to re-use the code for these endpoints to retrieve data for server-side rendering, which I do in some instances to play nicely with search engines. So, ideally I would implement some sort of HMVC setup to simply access a route on the API endpoint. Specifically I would like to get the response and perform additional actions on it before

Architecture: API as core for a website & mobile-app

依然范特西╮ 提交于 2019-12-04 05:04:02
I have different questions about a full architecture idea. I hope someone with great experience could help me out because I am pretty much getting stuck in all possibilities. I'm planning to rewrite a community website. Our customer wants to make use of native mobile apps in the future. So I will need to take this into account. Because of this I have decided to create a 100% REST API architecture based on the PHP framework Kohana. I have choosen Kohana because this makes scaling the internal API to a other server very easily without much extra effort. (Kohana threats internal url requests not

HMVC and dynamic widgets

混江龙づ霸主 提交于 2019-12-03 16:11:21
Background I use the word widget as a partial view that have its own controller (so its own actions) and it is placed in almost all pages. I implement the rendering of this via HMVC, that is just great. Problem Now, the problem is that the widget itself execute actions. Think about a shopping cart widget. That widget is placed in all pages so the user can see his/her stuff all along. And the widget have actions that are related to it, for instance: RemoveItem, RefreshCart, ApplyDiscountCoupon, etc. Such actions should trigger by a button or link and the link should be something like (in HMVC):

How to create a widget system in Codeigniter

萝らか妹 提交于 2019-12-03 07:24:38
问题 I am creating a custom CMS in Codeigniter and I'd like to have a widget system similar to what is used in Wordpress. For example, I'd like to have a widget that shows the last 5 posts displayed on the sidebar. I'd also like to be able to control what pages this widget appears on page-by-page basis. I am using Phil Sturgeon's Template library, so an example controller looks like: $this->template->set_partial('header', 'layouts/header'); $this->template->set_partial('footer', 'layouts/footer');