Create a folder inside the component folder laravel - laravel

I have a project that will contain a lot of components, however I want to divide the folder of components into section as you can see:
However when I use the component inside the test folder I'm getting an error:
View [components.admin-panel-main-navbar] not found
How can I fix this issue?

You may use the . character to indicate if a component is nested deeper inside the components directory. For example, assuming the component is defined at resources/views/components/inputs/button.blade.php, you may render it like so:
<x-inputs.button/>
https://laravel.com/docs/8.x/blade#anonymous-components
So in your case
<x-test.admin-panel-main-navbar/>

Related

What's the max number of folders nested in an ExtJS Application?

Well, turns out I have an ExtJS application. My views folder structure (if not the best), is this:
CE\app\view\process\Pre
OK, inside this folder, I created some components in some other folders, such as:
CE\app\view\process\Pre\StudentData\Tabs\GeneralDataTab.js
CE\app\view\process\Pre\StudentData\Tabs\AddressDataTab.js
CE\app\view\process\Pre\StudentData\Tabs\SchoolDataTab.js
CE\app\view\process\Pre\ParentData\Common\DataPanel.js
I define all of these componentes like this:
Ext.define("CE.view.process.Pre.StudentData.Tabs.GeneralDataTab", {
//some code to define and create my class
});
According to my research, I must name my class with the original folder structure, separared by dots.
Everything was fine while I was developing, but once I executed SENCHA CMD BUILD to test the results, I got this error:
Couldn't find "Tabs" of undefined/Couldn't find "Common" of undefined
I checked many times the paths, the names and everything was OK.
So, I remove the last folders (Tabs/Common):
CE\app\view\process\Pre\StudentData\GeneralDataTab.js
CE\app\view\process\Pre\StudentData\AddressDataTab.js
CE\app\view\process\Pre\StudentData\SchoolDataTab.js
CE\app\view\process\Pre\ParentData\DataPanel.js
And voila! My application was working.
Everything happened after I ran SENCHA CMD BUILD, 'cause not even with SENCHA CMD BUILD TESTING I got this error.
Do you know if I mustn't nest that much folder structure in a Sencha ExtJS app?
I know I can define paths in the paths configuration of the application. I tried this, and renamed my classes, but It didn't work either.
Do you thing I did something wrong? Is it a bug of Sencha CMD? I'm using the version 4.0.1.45.
Thank you in advance.
EDIT:
I would like you to let you know that I resolved this problem, and I hope this could help you too.
In fact the problem wasn't the nested folders but the name of the classes.
In my Application.js file I added a new path, like this:
paths: {
//...
'ProcessViews' : '../CE/app/view/process',
},
And now my classes name look like this:
Ext.define("ProcessViews.Pre.StudentData.Tabs.GeneralDataTab", {
//some code to define and create my class
});
And now I don't get any error message and the application runs OK.
So, looks like a class name can't be that long. If you need it to, then you should use a path defined in the Application.js to make a shorter name. :)
Thank you.

ZF2 data table - configuring ZFTable

I am looking at zfmodules to get a datatable module, and have found the perfect one :
https://github.com/dudapiotr/ZfTable
..however there is very little explanation of how to configure it into an existing project, change the data source etc.
Does anyone have any experience of this module, or is successfully using it in production?
The thing that i understood from Question is " You want to inject this
Module in your current Application ", well i have checked the link [https://github.com/dudapiotr/ZfTable][1] and the module seems perfect to inject to your Application. *The only thing which seems unfitting is the 'data' folder, you should compile
'customer.sql' onto your database, and then remove the folder 'data', since it does not matches to the framework structure
**Try these steps **
*
create your sql database exactly as mentioned in customer.sql
copy this module to your application, with other residing modules (if any).
Add the module name to application.config.php in Application/config/autoload directory ( since you are adding module manually, you must add your module name there by yourself)
And last, Routing configuration of your module in Application/config/module.config.php
if you need any help in routing of step 4, go here [Zend framework not able to route the translated child routes
*

How To Use Model Of Another Application in Codeigniter

I am working on a project where I create Two Application hosted in same site.
My structure is given below…
SITE
SYSTEM
APPLICATION
font_end
back_end
Now my question is,is it possible to access model of one application from another application.
As example, I have a model named ‘User_model’ in font_end application. Is it possible to use this model from back_end application.
Thanks.
Yes, it is possible, but there is a but. It doesn't matter where your files are in an absolute sense, but it is not necessarily the easiest thing in the world to accomplish.
Your best bet is to use symlinks if you can and link them into a sub-directory of your models directory. This would be simple and clean.
Barring that, you should extend Loader and overwrite the &model method to look in the secondary directory (perhaps reassign $path to the alternate application's model folder if $path == 'frontend').
If that also isn't an option, loading is done through APPPATH.'models/'.$path . '/' .$model.EXT. This means you can access the model by the relative path to APPPATH.'models/'. Don't do that if you can possibly avoid it, however. It is non-obvious and an invitation to errors.
I tried your last version (error prone I know) and got this result:
Unable to locate the model you have specified: ext.
I used this load code to access the frontend model from my backend:
$this->load->model('APPPATH.'/models/frontend/'Frontend_Model'.'EXT');
apppath and ext constants should be used like variables, but if I put it this way my notepad ++ highlighting goes wrong:
$this->load->model(APPPATH.'/models/hp/'Homepage_Model'.EXT)
admin/application/model/accounts_model.php
application/controller/home.php
Put this code in home.php to use model of admin applicaton
$this->load->model('../../../Unicorn/application/models/accounts_model');

file/page not found when uploaded online

I am working on a new module of existing live project. It is a website developed in PHP Zend Framework. New module is on admin side. It runs properly on my localhost/virtualhost.
When I uploaded it online with correct directory path it is found that one file is not found.
It is called like
www.example.com/admin/controllerName/actionName
All the actions works except one action that doesn't display anything and returns exception error mentioning that page or file not found.
What could be the issue? I have checked folders. If one action for the same controller works than why doesn't other. Both have their .phtml files in View section.
Help would be appreciated.
Would I be right if I guessed your local development environment was Windows?
It's probably a filename case sensitivity issue.
Assuming your request looks like
www.example.com/admin/fusionmaps/newpage
I'm not sure how you've setup your modules but if it's reasonably standard, you should have something like this (note the upper and lowercase characters)
application/modules/admin/controllers/FusionmapsController.php
The controller classname should be Admin_FusionmapsController with action public function newpageAction()
The view script should be at
application/modules/admin/views/scripts/fusionmaps/newpage.phtml

Referencing script files from MVC

I am having problems referencing scripts that should be included in my view, when I access the page using a different route my scripts fail.
The idea is that two routes actually point to the same action:
http://localhost/PaydayWebsite/registration
http://localhost/PaydayWebsite/organizations/p001/departments/vest/employees/chn/registration
where the second just include more params for my action. I have tried using
ResolveUrl, Url.Content and mvccontribs Html.ScriptInclude but neither seem to work. Any ideas?
You should be able to use Url.Content, but you'll need to make your path relative to the root of the application rather than the current path.
Use
Url.Content( "~/Content/Scripts/jquery-1.3.2.min.js" )
rather than
Url.Content( "../../Content/Scripts/jquery-1.3.2.min.js" )

Resources