I got a code to resolve some errors. But can't figure out which framework or row php is used. Some codes were done in the structure of MVC. Can anybody help me to recognize it?
If anyone help me it will be great help for me.
I am providing the structure of my code:
Main Folder/
admin/
controllers/
htdocs/
logs/
views/
config.php
log4php.properties
require.php
common/
_common-chk.php
_common-config.php
common-chk.php
common-config.php
common-func.php
framework/
mvc/
libs/
manage/
controllers/
htdocs/
logs/
views/
config.php
log4php.properties
require.php
models/
dao/
public/
controllers/
htdocs/
logs/
views/
config.php
log4php.properties
require.php
Related
I want to override the error templates in Symfony 3. I've started by creating a TwigBundle folder withe the personalised twig.
app/
└─ Resources/
└─ TwigBundle/
└─ Exception/
├─ error404.html.twig
├─ error403.html.twig
├─ error.html.twig
Then I checked the routing_dev file which contains this lines :
_errors:
resource: "#TwigBundle/Resources/config/routing/errors.xml"
prefix: /_error
Symfony still displays the default error templates. I want to know if I should verify something else.
PS : I have already checked this documentation : How to Customize Error Pages
EDIT :
The overriden files should reside in a subfolder named views. The correct file tree would look like this:
app/
└─ Resources/
└─ TwigBundle/
└─ views/
└─ Exception/
├─ error404.html.twig
├─ error403.html.twig
├─ error.html.twig
Clear your cache afterwards.
Be aware that those overriden error templates do NOT show up in the dev environment.
If you want to test the templates in your dev environment you must ensure you have imported the following in routing_dev.yml:
_errors:
resource: "#TwigBundle/Resources/config/routing/errors.xml"
prefix: /_error
Now you can access /_error/<error-code>.html (i.e. localhost:8000/_error/404.html with the integrated webserver)
I am curious if there is a best practice concerning the location of a website's cache folder (templates, images, etc)?
I often see it residing in the webroot with index.html/index.php like so,
Server
`-- /var/
`-- www/
-- example.com/
|-- .git/
|-- public_html/
| |-- cache/
| |-- assets/
| `-- index.html
|-- src/
|-- test/
|-- .gitignore
`-- package.json
However, would it be considered bad practice or create any security concerns if I place the cache folder up one level with the rest of the private project files (.git, node_modules, etc)? Like so...
Server
`-- /var/
`-- www/
-- example.com/
|-- .git/
|-- cache/
|-- public_html/
| |-- assets/
| `-- index.html
|-- src/
|-- test/
|-- .gitignore
`-- package.json
Apologies if this isn't a question for here, but I wasn't able to find much information on best practices regarding project folder structure for the cache. The only stuff I could find was about best practices on using the browser cache and other caching tools.
Thanks!
I have a design doubt about Symfony 2. The fact is I want to use a trait into a bundle of mine but I am not sure where to locate the trait. It is not a controller, it is not a model or entity.
I have a solutions on mind but I am not sure if it follows the best practice. The idea is create a new folder called /Trait. It is correct?
<your-bundle>/
├─ AcmeBlogBundle.php
├─ Controller/
├─ Entity/
├─ Trait/ <- My thought
├─ README.md
├─ LICENSE
├─ Resources/
│ ├─ config/
│ ├─ doc/
│ │ └─ index.rst
│ ├─ translations/
│ ├─ views/
│ └─ public/
└─ Tests/
Thank you very much
You can't use Trait, since it's a php keyword, so you'll have to use Traits, but apart from that, your suggestion is fine.
Bundle structure is only there for your convenience, it shouldn't be something limiting you, feel free to create any namespaces as you like. In fact you can use Symfony without bundles at all.
In a Yii project I have the structure:
project/
... default Yii structure here ...
themes/
css/
font/
images/
js/
views/
admin/
layouts/
site/
How to configure Gii to generate CRUD in themes folder?
I am new to CI and I tried to use the normal HMTL file as template. So I made a folder in 'application/views' named 'education'. I made a header.php, navigation.php, content.php and footer.php file. In the controller I wrote
class Education extends CI_Controller {
function index() {
$this->load->view('education/header');
$this->load->view('education/navigation');
$this->load->view('education/content');
$this->load->view('education/footer');
}
}
Then I accessed the link like "http://localhost:8080/mvc/index.php/education/"
But the stylesheet is not getting attached, which is in the same folder as the files. I also tried changing the href of the stylesheet link to "echo base_url();application/views/education/style.css". But it din't work either.
Any help
thanks
You shouldn't keep style sheets/js files/images in your application folder.. Keep them outside the application folder in some folder like "static" and access them using base_url()
A good file/folder structure would be the below:
website_folder/
–––– application/
–––––––– config/
–––––––––––– autoload.php
–––––––––––– config.php
–––––––––––– ...
–––––––– controllers/
–––––––––––– examples.php
–––––––––––– index.html
–––––––––––– welcome.php
–––––––– ...
–––––––– views/
––––––––---- templates/
––––––––-------- backend.php
––––––––-------- frontend.php
–––––––––––– ....
–––––––––––– example.php
–––––––––––– index.html
–––––––––––– welcome_message.php
–––– assets/
–––––––– css/
–––––––– js/
–––––––– images/
–––––––– templates/
––––––––---- frontend/
––––––––-------- css/
––––––––-------- js/
––––––––-------- images/
––––––––---- backend/
––––––––-------- css/
––––––––-------- js/
––––––––-------- images/
–––––––– uploads/
–––––––– index.html
–––– system/
–––– user_guide/
–––– index.php
–––– license.txt
Refer this and this..
File: (your_site)/application/views/education/header.php
....
<LINK href="/static/some.css" rel="stylesheet" type="text/css">
....
File (your_site)/static/some.css
....
some styles
....