![]() |
[Solved] Codeigniter form to find theme and update save. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: [Solved] Codeigniter form to find theme and update save. (/showthread.php?tid=60548) |
[Solved] Codeigniter form to find theme and update save. - El Forum - 04-20-2014 [eluser]riwakawd[/eluser] Hello. Currently I have in my app/config/setting.php a area where I can change the current theme manually. $config['config_template'] = 'codeigniter'; In my module/settings controller I have got a script that finds and locates themes but can not seem to switch the themes. I am trying to get it so do not have to enter it manually to change the name. SettingsController.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Settings.view Code: <?php echo form_open_multipart('module/settings');?> this is how is displayed on home controller. Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); [Solved] Codeigniter form to find theme and update save. - El Forum - 04-20-2014 [eluser]InsiteFX[/eluser] Most od the CI directories are read only see the .htaccess files in the directory to see why [Solved] Codeigniter form to find theme and update save. - El Forum - 04-20-2014 [eluser]riwakawd[/eluser] [quote author="InsiteFX" date="1397994067"]Most od the CI directories are read only see the .htaccess files in the directory to see why [/quote] How would you get the theme from folder. In select form. At the moment I just have to change the name each time want to choose different theme Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); It would be easier if I can just choose from a drop down list from my views/theme I have a settings.php controller which is in my admin area where function set_theme() is. Just something like opencarts theme selection area. this is what is in my home.php controller index Code: if (file_exists(APPPATH.'views/theme/'.$this->config->item('config_template').'/template/common/home.tpl')) { [Solved] Codeigniter form to find theme and update save. - El Forum - 04-20-2014 [eluser]InsiteFX[/eluser] If you can get the theme name then you can use this to set the name in the config. Code: $this->config->set_item('item_name', 'item_value'); [Solved] Codeigniter form to find theme and update save. - El Forum - 04-20-2014 [eluser]riwakawd[/eluser] [quote author="InsiteFX" date="1397999555"]If you can get the theme name then you can use this to set the name in the config. Code: $this->config->set_item('item_name', 'item_value'); Where do I use it though. <select> <option value="<?php echo $this->config->set_item('views/theme');?> </select> I am stuck on this. [Solved] Codeigniter form to find theme and update save. - El Forum - 04-20-2014 [eluser]riwakawd[/eluser] [quote author="InsiteFX" date="1397999555"]If you can get the theme name then you can use this to set the name in the config. Code: $this->config->set_item('item_name', 'item_value'); On My settings.tpl Code: <select name="config_template"> Not know what to add to controller yet to be able to find theme. [Solved] Codeigniter form to find theme and update save. - El Forum - 04-20-2014 [eluser]InsiteFX[/eluser] Take off the FCPATH and just use the APPPATH [Solved] Codeigniter form to find theme and update save. - El Forum - 04-21-2014 [eluser]riwakawd[/eluser] [quote author="InsiteFX" date="1398013450"]Take off the FCPATH and just use the APPPATH[/quote] Got code now working but just does not apply the theme. I can see themes in the theme folder but have not any idea now how to make it work with codeigniter so when click save it will change theme Config file settings.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Settings Controller Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); View Code: <?php echo form_open('module/settings'); ?> [Solved] Codeigniter form to find theme and update save. - El Forum - 04-21-2014 [eluser]InsiteFX[/eluser] Do a redirect and refresh When I change my themes it's just changing the css file. [Solved] Codeigniter form to find theme and update save. - El Forum - 04-21-2014 [eluser]riwakawd[/eluser] [quote author="InsiteFX" date="1398075339"]Do a redirect and refresh When I change my themes it's just changing the css file. [/quote] I know how to do it manually. But I am creating admin so users can upload there theme in to theme folder and the got to admin and choose/select there them. |