I know what a continuous joomla components, I find that for each component (example com_users) consists of three standard folder (Models, Views, Controllers) and the controller class for the controller of controllers controlos file
my question is: what are the standard folders + files from a joomla component??
why there are several folders in the views folder of a joomla component is that for each file in the folder represents viewrs action on this page
below is the joomla component folder structure.
main folder
site
admin
files
in - site folder
componentname.php
controller.php
in site folder - views folder
in views folder - view name folder
view.html.php
in view name folder - tmpl folder
default.php
in site folder - models folder
models.php
in site folder - controllers folder
controllername.php
referance below link
http://docs.joomla.org/File_Structure_and_Naming_Conventions
Related
If my Codeigniter 4 files are in
www.website/projects/my_cifiles
and my Codeigniter index.php files is located in
www.website/projects/my_cifiles/public
How can I copy an instance of Codeigniter into
www.website/
without Codeigniter affecting the index file in www.website/ ?
Will get_instance() bring the codeigniter class into www.website/ directory?
If you place a file called 'index.php' into www.website/ and in that file you include the following line:
require_once('/projects/my_cifiles/public/index.php');
It will point your browser to the public folder and continue from there.
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 am having subfolder named 'auth' inside the view folder, and i am having a controller named 'job' i am having some files inside "auth" folder where i have to call in some form actions and also for some validations like the users are already login, email verifications etc etc....
I am new to codeigniter so please help.me how i can connect the files which is inside a "auth" folder to forms and various validations
I also tried by $this->load->view('auth/login') but not working, is there anything i have to do
Please reply with explanations as i am doing a project it will help.me in future projects
I am working on a project that is using HMVC stucture for my codeigniter project and using an assets and template library to handle different assets and templates and themes. Its the libraries from PyroCMS. As of right now I'm hardcoding my values in as since.
I do have a little bit of a difference between my file structure and that of PyroCMS as they have a folder inside their system folder for that houses all of their application files.
Asset::add_path('theme', APPPATH . 'themes/mythem/assets/');
Asset::set_path('theme');
When I echo out the asset for my page for the current theme I'm using it shows up as
http://dev.mysite.com/application/themes/mytheme/assets/css/bootstrap/bootstrap.css
application/
themes/
mytheme/
assets/
css/
whatever.css
assets/
cache/
system/
public_html/
index.php
You can't access the application folder directly.
EDIT
You CAN access the application folder directly, but you really shouldn't. It's not safe because it allows direct access to your logic files (controllers, models, etc.). Refer to this question: CodeIgniter + CSS
Stick your assets folder outside of application and add it to your .htaccess file:
RewriteCond $1 !^(assets|other_toplevel_folders)
I have created my site with controllers such as about, products etc... which gives me example.com/about/ etc..
How would I create a admin section with the same controller name, like example.com/admin/about or example.com/admin/products ?
How do I organize my controllers?
2 more options to compliment WebweaverD answer.
Use Modular Separation
Create a second application folder and index file, that will be responsible for admin, connect them to the same system folder.
The second option is really easy to manage once you have set it up. There are variations but I find the structure below to be the most convenient.
mykewlwebsite.com
apps/
frontend/
app/ frontend codeigniter application folder
public/
index.php
assets/ frontend js, css, images
backend
app/ backend codeigniter application folder
public/
index.php
assets/ backend js, css, images
config/
database.php
constants.php
system/ codeigniter system folder
The database.php file contains the code from CodeIgniter's config/database.php and is shared for all applications of your project - simply remove all code and add require_once('../../../../config/database.php'); to the config/database.php
index.php files inside public folders have two important variables $system_path and $application_folder, change them to
$system_path = '../../../system/codeigniter';
$application_folder = '../app';
constants.php file can have some constants like the ENVIRONMENT constant from the index.php files and some other. Just require_once() it from the index.php files.
Though there are pros and cons.
PROS
For those of you, who are developing on localhost and deploying to servers via FTP or other systems can simply upload one folder - apps and overwrite the target folder without fear of overwriting database.php settings (I'm sure most of you have them different from the local ones).
Adding one more application is easy - just duplicate one of existing. You can add as many applications as you want - api, ajax, user cabinet, etc.
CONS
This structure is meant to be used if you have a domain as mykewlwebsite.com and have the ability to add sub-domains to it, so you just configure the home folders for each of them:
mykewlwebsite.com: path/to/mykewlwebsite.com/apps/frontend/public/
admin.mykewlwebsite.com: path/to/mykewlwebsite.com/apps/backend/public/
api.mykewlwebsite.com: path/to/mykewlwebsite.com/apps/api/public/
You have a few options here:
1) CREATE A SUBFOLDER - Put them in a folder called admin within the controllers directory (in application/contollers/admin/products.php)
A word of warning here is that you can only go one folder deep or codeigniter gets upset. Also, it will use first level controller/methods first so be careful of naming conflicts - e.g if you have an admin controller with a products method in it, that will get called before it looks in the admin directory for a products controller. (when going to example.com/admin/products)
2) USE THE ROUTES FILE - If it is just the urls you are worried about you could just call the controllers whatever you want and use the application/config/routes to redirect those paths to the controllers you want like this:
controller name: admin_products.php
routes file:
$route['admin/products'] = "admin_products";
3) USE A MASTER CONTROLLER FOR ALL - Final option would be to have a single admin controller and use named methods inside it, so for example you have admin.php controller with a products method within it this would then be called by admin/products uri (this will probably get messy though in a big application/site - not recommended)
Hope I have explained this OK for you, if you need any clarification please ask and I will try to elaborate.