Configure Yii to generate CRUD(Gii) in themes folder - php

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?

Related

How to override errors templates for Symfony

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)

Which framework is used: PHP MVC

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

Create sub Module folders in laravel 5.1 using pingpong package

I am developing modular project in laravel 5.1 using pingpong package.Which gives me the project structure as below
laravel-app/
app/
bootstrap/
vendor/
modules/
├── Blog/
├── Assets/
├── Config/
├── Console/
├── Database/
├── Migrations/
├── Seeders/
├── Entities/
├── Http/
├── Controllers/
├── Middleware/
├── Requests/
├── routes.php
├── Providers/
├── BlogServiceProvider.php
├── Resources/
├── lang/
├── views/
├── Repositories/
├── Tests/
├── composer.json
├── module.json
├── start.php
I want to separate this modules folders in "admin" and "client" for differentiate my client and admin side like below,
laravel-app/
app/
bootstrap/
vendor/
modules/
├── Admin/
├── Blog/
├── Assets/
├── Config/
├── Console/
├── Database/
├── Migrations/
├── Seeders/
├── Entities/
├── Http/
├── Controllers/
├── Middleware/
├── Requests/
├── routes.php
├── Providers/
├── BlogServiceProvider.php
├── Resources/
├── lang/
├── views/
├── Repositories/
├── Tests/
├── composer.json
├── module.json
├── start.php
├── Client/
├── Blog/
├── Assets/
├── Config/
├── Console/
├── Database/
├── Migrations/
├── Seeders/
├── Entities/
├── Http/
├── Controllers/
├── Middleware/
├── Requests/
├── routes.php
├── Providers/
├── BlogServiceProvider.php
├── Resources/
├── lang/
├── views/
├── Repositories/
├── Tests/
├── composer.json
├── module.json
├── start.php
please help me out for this,
Thanks.
UPDATE:
You can mostly achieve what you are looking for by adjusting the config/modules.php file, but you will have to switch it back and forth when switching between Admin and Client.
For example:
To generate (module:make) or use (module:use) modules within the Admin portion of your project, you will need to do the following:
In the config/modules.php file, adjust the namespace to
/*
|--------------------------------------------------------------------------
| Module Namespace
|--------------------------------------------------------------------------
|
| Default module namespace.
|
*/
'namespace' => 'Modules\Admin',
In the same file, adjust the base_path to
/*
|--------------------------------------------------------------------------
| Modules path
|--------------------------------------------------------------------------
|
| This path used for save the generated module. This path also will added
| automatically to list of scanned folders.
|
*/
'modules' => base_path('modules/admin'),
That is all you need to do and calling php artisan module:make blog will create a Blog module within modules/admin.
If you need to switch between the Admin and the Client portion of your project, you will need to adjust the same two lines within the config/modules.php file to reflect as such.
There is one more caveat:
If you are planning to use the Assets folder within your modules, you will need to also adjust the corresponding line within the config/modules.php file, AND you will need to manually adjust a couple of methods with file paths explicitly written within your module's service provider (ex: Admin/Blog/Providers/BlogServiceProvider.php), AND you will need to fix your config/view.php - just follow the comments.
P.S. you can probably create a custom command to automate switching between Admin and Client.

Doctrine - Configure Entities in more than one directory

I'm starting in Doctrine 2.4 and I'm developing a system where I separate the core files and application files, as follows:
/ root
    |-- /Src
         |-- / App
               |-- /Model
                     |- ** (Application Entities) **
         |-- /Core
               |-- /Model
                     |-- ** (Core Entities) **
In the Doctrine documentation shows the following form to set 1 directory for Esntitys:
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__. "/src"), $isDevMode);
But when I have to configure more than one directory that will contain the Entitys of my application, how to proceed?
Thanks in advance!
I found a way to resolve the issue. Simple!!!
Put like this:
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src/App/Model/", __DIR__."/src/Core/Model/"), $isDevMode);

Stylesheet not getting attached in Codeigniter

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
....

Categories