I'm using the Phil Sturgeon Template Libray within the MX_Controller but I can't load the layout file located inside /modules/auth/views/layouts/auth_login.php, views and partials are loaded without problem.
// *auth_login* is placed in /modules/auth/views/layouts/auth_login.php
$this->template->set_layout('auth_login')
->build('auth/login', $this->data);
I'm missing something?
Related
I have a layouts folder under views folder where the master.blade.php is placed and I have includes folder under views folder where nav.blade.php is placed.
I have a users folder under views where index.blade.php and create.blade.php are placed.
Now i have extended the master view in both index and create views but the problem is that index page shows the navigation bar which is in includes folder and create page does not show it.
Master Page:
Index Page:
Create Page:
I googled this but could not find any solution.
Probably there are some issues in loading css and js files into the page.
To be sure to load them correctly don't write the path by hand but use the method:
URL:asset()
https://laravel.com/docs/5.4/helpers#method-asset
I'm using codeigniter 2.1.3 with wiredesignz HMVC, I was wondering how would I get templates from the public folder rather than the modules/module/views?
example structure
application/projects/projectname/ciappstructure
application/system/etc/
public/themes/themename/layout
public/themes/themename/pages
public/themes/themename/widgets
public/themes/themename/etc
I would love to use html files and have my template library sort out the tags and placement of widgets or modules, all modules and theme data being pulled from the DB
like:
$homepage = $this->load->view(FCPATH.'themes/$theme/pages/homepage.html', $data, TRUE);
Oh and another quick question, I'm new to HMVC, could I call modules::run('module/method', $params, $...); from a template library (/application/projects/project/libraries/template.php) ?
I've tried a few things but I can't seem to get anything working, any ideas are much appreciated! Thanks in advance
First, the $this->load->view() load views with .php extension not .html files, Second, this method only load the views on views/ folder.
Therefore, your need config first your modules folder in application/config.php file. Place this on the ends of file.
$config['modules_locations'] = array(
APPPATH . 'modules/' => '../modules/'
);
Next, create your first module with views as sub-folder, and create your view file with .php as extension.
- modules/
--- my_module/
------ views/
--------- my_view.php
Next, in your controller, load the view with the ubication of your module.
$this->load->view('my_module/my_view');
This must run, you can try and read more about the documentation.
Hope this help you!
I created a custom module called Drawings. I wanted to give it its own theme layout on the frontend, so I followed the advice I found HERE - I put a layout file titled Drawings.html in my theme.
This had the correct effect on the frontend, but caused other problems and questions that I've been struggling to sort out:
The backend admin section for my module now uses the Drawings.html layout, which breaks its functionality completely. How can I set a specific layout for my module front end, but keep the standard admin backend layout (same backend implementation as in the sample module tutorial)?
I read the following in the Template Library: "When using Public_Controller and Admin_Controller, the layout is already set." Perhaps the solution involves using the set_layout function in these controllers somehow? All my attempts failed so far though.
I feel I am doing something incorrectly because now my module is not modular. For example, after creating the Drawings.html layout file in the theme, a statement like {{ theme:css file="drawings.css"}} in that layout file searches for those resources in my theme. So I have to put those JS and CSS resources in my theme, instead of in my module's CSS and JS folders. How do I keep and access my resources in the module's JS and CSS folders?
I don't know how this is supposed to work.
When you are using front end controller use a layout there using philsturgeon template library like this
function index(){
$this->template->set_layout('drawing')
->build('yourview');
}
This way you can load a custom layout for your application.
When calling $this->loadLayout() in your controller, does Magento fetches all of the xml files from the layout folders in the current design package?
I am trying to figure out how the customer login form pulls out the template from:
persistent/customer/form/login.phtml, is it because there is only a layout file: persistent.xml present?
EDIT:
I figured it out I didn't see there is a new module in 1.6.1.0 and also there are changes in model resource names
The customer login form pulls in because of the template or code block type referenced in that block's XML tag (in persistent.xml).
I have a Codeigniter powered site at the root and a Magento powered product catalog inside a catalog folder. I was wondering if it is possible to load Codeigniter inside Magento so I can re-use partials, helpers, etc.
For example: I would like to share the same header in both platforms, so the header.php file in Codeigniter uses the url helper, and functions that Magento doesn't understand
How can I achieve this?
UPDATE:
I've tried the following:
CODEIGNITER
|
\_ CATALOG (Magento)
Inside Magento's index.php file I added:
include('../index.php');
$CI =& get_instance();
echo $CI->load->controller('welcome');
After this, I got an error "Can't find application folder" from Codeigniter when loading site/catalog. So something worked. I cheched this other SO question and inside Codeigniter index.php file I added:
$application_folder = dirname(__FILE__)."/application";
$system_path = dirname(__FILE__)."/system";
The first error was gone but then followed 5 php errors where it could not find CI/UTF8.php, CI/URI.php, CI/Benchmark.php... etc. These are CI core files which are referenced in the bootstap index.php.
This is where I'm stuck...
Have you tried to include your class files to your header templates and call the methods from external lib objects? Or better jet include already outputted header file?